Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: opal/opal
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 911abe69c29c
Choose a base ref
...
head repository: opal/opal
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 795cb013be12
Choose a head ref
  • 3 commits
  • 3 files changed
  • 1 contributor

Commits on Oct 29, 2013

  1. Copy the full SHA
    b688e60 View commit details
  2. Add specs for Array#hash

    adambeynon committed Oct 29, 2013
    Copy the full SHA
    81ab10e View commit details
  3. Copy the full SHA
    795cb01 View commit details
Showing with 28 additions and 4 deletions.
  1. +18 −4 spec/filters/bugs/array.rb
  2. +8 −0 spec/filters/unsupported/array_subclasses.rb
  3. +2 −0 spec/rubyspecs
22 changes: 18 additions & 4 deletions spec/filters/bugs/array.rb
Original file line number Diff line number Diff line change
@@ -37,6 +37,16 @@

fails "Array#dup creates a new array containing all elements or the original"

fails "Array#[] tries to convert the passed argument to an Integer using #to_int"
fails "Array#[] accepts Range instances having a negative m and both signs for n with [m..n] and [m...n]"
fails "Array#[] tries to convert Range elements to Integers using #to_int with [m..n] and [m...n]"
fails "Array#[] returns nil if range start is not in the array with [m..n]"
fails "Array#[] raises a RangeError when the start index is out of range of Fixnum"
fails "Array#[] raises a RangeError when the start index is out of range of Fixnum"
fails "Array#[] raises a RangeError when the length is out of range of Fixnum"
fails "Array#[] raises a RangeError when the length is out of range of Fixnum"
fails "Array.[] can unpack 2 or more nested referenced array"

fails "Array#[]= calls to_ary on its rhs argument for multi-element sets"
fails "Array#[]= raises an IndexError when passed indexes out of bounds"
fails "Array#[]= tries to convert Range elements to Integers using #to_int with [m..n] and [m...n]"
@@ -108,8 +118,6 @@

fails "Array#index returns the index of the first element == to object"

fails "Array#inspect calls inspect on its elements and joins the results with commas"

fails "Array#join calls #to_str to convert the separator to a String"
fails "Array#join does not call #to_str on the separator if the array is empty"
fails "Array#join raises a TypeError if the separator cannot be coerced to a String by calling #to_str"
@@ -187,8 +195,6 @@
fails "Array#slice! removes and return elements in range"
fails "Array#slice! calls to_int on start and length arguments"

fails "Array#to_s calls inspect on its elements and joins the results with commas"

fails "Array#transpose raises a TypeError if the passed Argument does not respond to #to_ary"
fails "Array#transpose tries to convert the passed argument to an Array using #to_ary"

@@ -213,4 +219,12 @@

fails "Array#zip calls #to_ary to convert the argument to an Array"
fails "Array#zip uses #each to extract arguments' elements when #to_ary fails"

fails "Array#hash returns the same value if arrays are #eql?"
fails "Array#hash returns same hash code for arrays with the same content"
fails "Array#hash ignores array class differences"
fails "Array#hash calls to_int on result of calling hash on each element"
fails "Array#hash returns the same hash for equal recursive arrays through hashes"
fails "Array#hash returns the same hash for equal recursive arrays"
fails "Array#hash returns the same fixnum for arrays with the same content"
end
8 changes: 8 additions & 0 deletions spec/filters/unsupported/array_subclasses.rb
Original file line number Diff line number Diff line change
@@ -24,4 +24,12 @@
fails "Array#slice with a subclass of Array returns a subclass instance with [n..m]"
fails "Array#slice with a subclass of Array returns a subclass instance with [-n, m]"
fails "Array#slice with a subclass of Array returns a subclass instance with [n, m]"

fails "Array#[] with a subclass of Array returns a subclass instance with [n, m]"
fails "Array#[] with a subclass of Array returns a subclass instance with [-n, m]"
fails "Array#[] with a subclass of Array returns a subclass instance with [n..m]"
fails "Array#[] with a subclass of Array returns a subclass instance with [n...m]"
fails "Array#[] with a subclass of Array returns a subclass instance with [-n..-m]"
fails "Array#[] with a subclass of Array returns a subclass instance with [-n...-m]"
fails "Array.[] with a subclass of Array returns an instance of the subclass"
end
2 changes: 2 additions & 0 deletions spec/rubyspecs
Original file line number Diff line number Diff line change
@@ -22,6 +22,7 @@ core/array/drop_while_spec
core/array/dup_spec
core/array/each_index_spec
core/array/each_spec
core/array/element_reference_spec
core/array/element_set_spec
core/array/empty_spec
core/array/eql_spec
@@ -32,6 +33,7 @@ core/array/find_index_spec
core/array/first_spec
core/array/flatten_spec
core/array/frozen_spec
core/array/hash_spec
core/array/include_spec
core/array/index_spec
core/array/initialize_spec