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: 35402eecb296
Choose a base ref
...
head repository: opal/opal
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 85210dc8cdcd
Choose a head ref
  • 3 commits
  • 63 files changed
  • 2 contributors

Commits on Jun 20, 2015

  1. Copy the full SHA
    b1cd8a8 View commit details
  2. Clean up and sort filters/bugs

    vais committed Jun 20, 2015
    Copy the full SHA
    9a12df7 View commit details
  3. Merge pull request #953 from vais/spec-filters

    A little tender love and care for spec/filters/unsupported and spec/filters/bugs
    adambeynon committed Jun 20, 2015
    Copy the full SHA
    85210dc View commit details
Showing with 2,960 additions and 3,323 deletions.
  1. +45 −64 spec/filters/bugs/array.rb
  2. +11 −12 spec/filters/bugs/basicobject.rb
  3. +7 −11 spec/filters/bugs/class.rb
  4. +119 −122 spec/filters/bugs/date.rb
  5. +37 −48 spec/filters/bugs/enumerable.rb
  6. +19 −19 spec/filters/bugs/enumerator.rb
  7. +56 −60 spec/filters/bugs/exception.rb
  8. +23 −23 spec/filters/bugs/fixnum.rb
  9. +55 −55 spec/filters/bugs/float.rb
  10. +26 −44 spec/filters/bugs/hash.rb
  11. +31 −31 spec/filters/bugs/integer.rb
  12. +258 −260 spec/filters/bugs/kernel.rb
  13. +203 −227 spec/filters/bugs/language.rb
  14. +58 −65 spec/filters/bugs/math.rb
  15. +246 −258 spec/filters/bugs/module.rb
  16. +3 −3 spec/filters/bugs/nil.rb
  17. +53 −53 spec/filters/bugs/numeric.rb
  18. +0 −9 spec/filters/bugs/opal.rb
  19. +51 −51 spec/filters/bugs/proc.rb
  20. +89 −89 spec/filters/bugs/range.rb
  21. +216 −217 spec/filters/bugs/regexp.rb
  22. +28 −32 spec/filters/bugs/set.rb
  23. +2 −3 spec/filters/bugs/singleton.rb
  24. +74 −88 spec/filters/bugs/string.rb
  25. +47 −53 spec/filters/bugs/strscan.rb
  26. +10 −17 spec/filters/bugs/struct.rb
  27. +233 −253 spec/filters/bugs/time.rb
  28. +8 −8 spec/filters/bugs/unboundmethod.rb
  29. +172 −0 spec/filters/unsupported/array.rb
  30. +11 −7 spec/filters/unsupported/{method_added.rb → basicobject.rb}
  31. +4 −0 spec/filters/unsupported/class.rb
  32. +5 −0 spec/filters/unsupported/delegator.rb
  33. +0 −102 spec/filters/unsupported/encoding.rb
  34. +8 −0 spec/filters/unsupported/enumerable.rb
  35. +8 −9 spec/filters/unsupported/enumerator.rb
  36. +10 −0 spec/filters/unsupported/fixnum.rb
  37. +0 −9 spec/filters/unsupported/float.rb
  38. +0 −92 spec/filters/unsupported/frozen.rb
  39. +53 −0 spec/filters/unsupported/hash.rb
  40. +0 −16 spec/filters/unsupported/hash_compare_by_identity.rb
  41. +3 −0 spec/filters/unsupported/integer.rb
  42. +0 −63 spec/filters/unsupported/integer_size.rb
  43. +21 −0 spec/filters/unsupported/kernel.rb
  44. +31 −0 spec/filters/unsupported/language.rb
  45. +33 −0 spec/filters/unsupported/matchdata.rb
  46. +3 −0 spec/filters/unsupported/math.rb
  47. +33 −3 spec/filters/unsupported/module.rb
  48. +3 −0 spec/filters/unsupported/pathname.rb
  49. +0 −30 spec/filters/unsupported/private_constants.rb
  50. +0 −56 spec/filters/unsupported/private_methods.rb
  51. +0 −4 spec/filters/unsupported/random.rb
  52. +0 −5 spec/filters/unsupported/rational_numbers.rb
  53. +69 −112 spec/filters/unsupported/{regular_expressions.rb → regexp.rb}
  54. +0 −5 spec/filters/unsupported/ruby_exe.rb
  55. +4 −0 spec/filters/unsupported/set.rb
  56. +4 −2 spec/filters/unsupported/{marshal.rb → singleton.rb}
  57. +462 −333 spec/filters/unsupported/{mutable_strings.rb → string.rb}
  58. +3 −0 spec/filters/unsupported/struct.rb
  59. +0 −19 spec/filters/unsupported/symbols.rb
  60. +0 −180 spec/filters/unsupported/tainted.rb
  61. +0 −3 spec/filters/unsupported/thread.rb
  62. +12 −10 spec/filters/unsupported/time.rb
  63. +0 −88 spec/filters/unsupported/trusted.rb
109 changes: 45 additions & 64 deletions spec/filters/bugs/array.rb
Original file line number Diff line number Diff line change
@@ -1,106 +1,87 @@
opal_filter "Array" do
fails "Array#clone copies singleton methods"

fails "Array.[] can unpack 2 or more nested referenced array"

fails "Array#initialize with (size, object=nil) sets the array to the values returned by the block before break is executed"
fails "Array#initialize with (size, object=nil) returns the value passed to break"
fails "Array#initialize with (size, object=nil) uses the block value instead of using the default value"
fails "Array#initialize with (size, object=nil) yields the index of the element and sets the element to the value of the block"
fails "Array#initialize with (size, object=nil) sets the array to size and fills with the object"
fails "Array#initialize preserves the object's identity even when changing its value"

fails "Array#& determines equivalence between elements in the sense of eql?"

fails "Array#* with a string returns a string formed by concatenating each element.to_str separated by separator"
fails "Array#* with a string uses the same separator with nested arrays"
fails "Array#- doesn't remove an item with the same hash but not #eql?"
fails "Array#- removes an item identified as equivalent via #hash and #eql?"

fails "Array#* with a string uses the same separator with nested arrays"
fails "Array#* with a string returns a string formed by concatenating each element.to_str separated by separator"

fails "Array#<=> properly handles recursive arrays"
fails "Array#clone copies singleton methods"
fails "Array#combination when no block is given returned Enumerator size returns 0 when the number of combinations is < 0"
fails "Array#combination when no block is given returned Enumerator size returns the binomial coeficient between the array size the number of combinations"
fails "Array#first raises a RangeError when count is a Bignum"
fails "Array#flatten performs respond_to? and method_missing-aware checks when coercing elements to array"

fails "Array#rassoc does not check the last element in each contained but speficically the second"
fails "Array#hash returns the same fixnum for arrays with the same content"
fails "Array#hash returns the same hash for equal recursive arrays through hashes"
fails "Array#initialize preserves the object's identity even when changing its value"
fails "Array#initialize with (size, object=nil) returns the value passed to break"
fails "Array#initialize with (size, object=nil) sets the array to size and fills with the object"
fails "Array#initialize with (size, object=nil) sets the array to the values returned by the block before break is executed"
fails "Array#initialize with (size, object=nil) uses the block value instead of using the default value"
fails "Array#initialize with (size, object=nil) yields the index of the element and sets the element to the value of the block"
fails "Array#join raises a NoMethodError if an element does not respond to #to_str, #to_ary, or #to_s"
fails "Array#partition returns in the left array values for which the block evaluates to true"
fails "Array#permutation when no block is given returned Enumerator size with an array size greater than 0 returns the descending factorial of array size and given length"
fails "Array#permutation when no block is given returned Enumerator size with an array size greater than 0 returns the descending factorial of array size with array size when there's no param"
fails "Array#permutation when no block is given returned Enumerator size with an empty array returns 1 when the given length is 0"
fails "Array#permutation when no block is given returned Enumerator size with an empty array returns 1 when there's param"
fails "Array#pop passed a number n as an argument raises an ArgumentError if more arguments are passed"
fails "Array#rassoc calls elem == obj on the second element of each contained array"

fails "Array#repeated_combination generates from a defensive copy, ignoring mutations"
fails "Array#rassoc does not check the last element in each contained but speficically the second"
fails "Array#repeated_combination accepts sizes larger than the original array"
fails "Array#repeated_combination yields a partition consisting of only singletons"
fails "Array#repeated_combination yields nothing when the array is empty and num is non zero"
fails "Array#repeated_combination yields [] when length is 0"
fails "Array#repeated_combination yields the expected repeated_combinations"
fails "Array#repeated_combination yields nothing for negative length and return self"
fails "Array#repeated_combination returns self when a block is given"
fails "Array#repeated_combination generates from a defensive copy, ignoring mutations"
fails "Array#repeated_combination returns an enumerator when no block is provided"
fails "Array#repeated_combination returns self when a block is given"
fails "Array#repeated_combination when no block is given returned Enumerator size returns 0 when the combination_size is < 0"
fails "Array#repeated_combination when no block is given returned Enumerator size returns 1 when the combination_size is 0"
fails "Array#repeated_combination when no block is given returned Enumerator size returns the binomial coeficient between combination_size and array size + combination_size -1"

fails "Array#repeated_permutation generates from a defensive copy, ignoring mutations"
fails "Array#repeated_combination yields [] when length is 0"
fails "Array#repeated_combination yields a partition consisting of only singletons"
fails "Array#repeated_combination yields nothing for negative length and return self"
fails "Array#repeated_combination yields nothing when the array is empty and num is non zero"
fails "Array#repeated_combination yields the expected repeated_combinations"
fails "Array#repeated_permutation allows permutations larger than the number of elements"
fails "Array#repeated_permutation returns an Enumerator which works as expected even when the array was modified"
fails "Array#repeated_permutation truncates Float arguments"
fails "Array#repeated_permutation handles duplicate elements correctly"
fails "Array#repeated_permutation does not yield when called on an empty Array with a nonzero argument"
fails "Array#repeated_permutation yields the empty repeated_permutation ([[]]) when the given length is 0"
fails "Array#repeated_permutation yields all repeated_permutations to the block then returns self when called with block but no arguments"
fails "Array#repeated_permutation generates from a defensive copy, ignoring mutations"
fails "Array#repeated_permutation handles duplicate elements correctly"
fails "Array#repeated_permutation returns an Enumerator of all repeated permutations of given length when called without a block"
fails "Array#repeated_permutation returns an Enumerator which works as expected even when the array was modified"
fails "Array#repeated_permutation truncates Float arguments"
fails "Array#repeated_permutation when no block is given returned Enumerator size returns 0 when combination_size is < 0"
fails "Array#repeated_permutation when no block is given returned Enumerator size returns array size ** combination_size"

fails "Array#repeated_permutation yields all repeated_permutations to the block then returns self when called with block but no arguments"
fails "Array#repeated_permutation yields the empty repeated_permutation ([[]]) when the given length is 0"
fails "Array#rindex rechecks the array size during iteration"

fails "Array#select returns a new array of elements for which block is true"

fails "Array#shift passed a number n as an argument raises an ArgumentError if more arguments are passed"
fails "Array#shuffle accepts a Float for the value returned by #rand"
fails "Array#shuffle attempts coercion via #to_hash"
fails "Array#shuffle calls #rand on the Object passed by the :random key in the arguments Hash"
fails "Array#shuffle ignores an Object passed for the RNG if it does not define #rand"
fails "Array#shuffle accepts a Float for the value returned by #rand"
fails "Array#shuffle calls #to_int on the Object returned by #rand"
fails "Array#shuffle raises a RangeError if the value is less than zero"
fails "Array#shuffle ignores an Object passed for the RNG if it does not define #rand"
fails "Array#shuffle raises a RangeError if the value is equal to one"

fails "Array#shuffle raises a RangeError if the value is less than zero"
fails "Array#slice! calls to_int on range arguments"
fails "Array#slice! calls to_int on start and length arguments"
fails "Array#slice! does not expand array with indices out of bounds"
fails "Array#slice! does not expand array with negative indices out of bounds"
fails "Array#slice! removes and return elements in range"
fails "Array#slice! removes and returns elements in end-exclusive ranges"
fails "Array#slice! returns nil if length is negative"

fails "Array#sort_by! completes when supplied a block that always returns the same result"
fails "Array#sort_by! makes some modification even if finished sorting when it would break in the given block"
fails "Array#sort_by! returns the specified value when it would break in the given block"
fails "Array#sort_by! raises a RuntimeError on an empty frozen array"
fails "Array#sort_by! raises a RuntimeError on a frozen array"
fails "Array#sort_by! completes when supplied a block that always returns the same result"
fails "Array#sort_by! raises a RuntimeError on an empty frozen array"
fails "Array#sort_by! returns an Enumerator if not given a block"
fails "Array#sort_by! returns the specified value when it would break in the given block"
fails "Array#sort_by! sorts array in place by passing each element to the given block"
fails "Array#sort_by! when no block is given returned Enumerator size returns the enumerable size"

fails "Array#uniq compares elements based on the value returned from the block"
fails "Array#uniq compares elements with matching hash codes with #eql?"
fails "Array#uniq handles nil and false like any other values"
fails "Array#uniq uses eql? semantics"
fails "Array#uniq yields items in order"
fails "Array#uniq! compares elements based on the value returned from the block"

fails "Array#hash returns the same fixnum for arrays with the same content"

fails "Array#partition returns in the left array values for which the block evaluates to true"

fails "Array#| acts as if using an intermediate hash to collect values"

# recursive arrays
fails "Array#uniq! properly handles recursive arrays"
fails "Array#<=> properly handles recursive arrays"
fails "Array#hash returns the same hash for equal recursive arrays through hashes"

fails "Array#first raises a RangeError when count is a Bignum"

fails "Array#combination when no block is given returned Enumerator size returns 0 when the number of combinations is < 0"
fails "Array#combination when no block is given returned Enumerator size returns the binomial coeficient between the array size the number of combinations"
fails "Array#permutation when no block is given returned Enumerator size with an array size greater than 0 returns the descending factorial of array size and given length"
fails "Array#permutation when no block is given returned Enumerator size with an array size greater than 0 returns the descending factorial of array size with array size when there's no param"
fails "Array#permutation when no block is given returned Enumerator size with an empty array returns 1 when the given length is 0"
fails "Array#permutation when no block is given returned Enumerator size with an empty array returns 1 when there's param"
fails "Array#| acts as if using an intermediate hash to collect values"
fails "Array.[] can unpack 2 or more nested referenced array"
end
23 changes: 11 additions & 12 deletions spec/filters/bugs/basicobject.rb
Original file line number Diff line number Diff line change
@@ -1,34 +1,33 @@
opal_filter "BasicObject" do
fails "BasicObject#instance_eval evaluates strings"
fails "BasicObject#singleton_method_added is called when a method is defined with alias_method in the singleton class"
fails "BasicObject#singleton_method_added is called when a method is defined with syntax alias in the singleton class"
fails "BasicObject does not define built-in constants (according to const_defined?)"
fails "BasicObject does not define built-in constants (according to defined?)"
fails "BasicObject instance metaclass contains methods defined for the BasicObject instance"
fails "BasicObject instance metaclass has BasicObject as superclass"
fails "BasicObject instance metaclass is an instance of Class"
fails "BasicObject metaclass contains methods for the BasicObject class"
fails "BasicObject metaclass has Class as superclass"
fails "BasicObject does not define built-in constants (according to defined?)"
fails "BasicObject does not define built-in constants (according to const_defined?)"
fails "BasicObject raises NameError when referencing built-in constants"
fails "BasicObject raises NoMethodError for nonexistent methods after #method_missing is removed"

fails "BasicObject#__id__ returns a different value for two Bignum literals"
fails "BasicObject#__id__ returns a different value for two Float literals"
fails "BasicObject#__id__ returns a different value for two String literals"
fails "BasicObject#initialize does not accept arguments"
fails "BasicObject#instance_eval binds self to the receiver"
fails "BasicObject#instance_eval evaluates strings"
fails "BasicObject#instance_eval executes in the context of the receiver"
fails "BasicObject#instance_eval gets constants in the receiver if a string given"
fails "BasicObject#instance_eval has access to receiver's instance variables"
fails "BasicObject#instance_eval treats block-local variables as local to the block"
fails "BasicObject#instance_eval sets class variables in the receiver"
fails "BasicObject#instance_eval makes the receiver metaclass the scoped class when used with a string"
fails "BasicObject#instance_eval gets constants in the receiver if a string given"
fails "BasicObject#instance_eval raises a TypeError when defining methods on an immediate"
fails "BasicObject#instance_eval raises a TypeError when defining methods on numerics"
fails "BasicObject#instance_exec raises a LocalJumpError unless given a block"
fails "BasicObject#instance_exec has an arity of -1"
fails "BasicObject#instance_eval sets class variables in the receiver"
fails "BasicObject#instance_eval treats block-local variables as local to the block"
fails "BasicObject#instance_exec binds the block's binding self to the receiver"
fails "BasicObject#instance_exec sets class variables in the receiver"
fails "BasicObject#instance_exec has an arity of -1"
fails "BasicObject#instance_exec raises a LocalJumpError unless given a block"
fails "BasicObject#instance_exec raises a TypeError when defining methods on an immediate"
fails "BasicObject#instance_exec raises a TypeError when defining methods on numerics"
fails "BasicObject#instance_exec sets class variables in the receiver"
fails "BasicObject#singleton_method_added is called when a method is defined with alias_method in the singleton class"
fails "BasicObject#singleton_method_added is called when a method is defined with syntax alias in the singleton class"
end
18 changes: 7 additions & 11 deletions spec/filters/bugs/class.rb
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
opal_filter "Class" do
fails "Class#allocate returns a fully-formed instance of Module"
fails "Class#allocate raises TypeError for #superclass"

fails "Class#dup stores the new name if assigned to a constant"
fails "Class#dup sets the name from the class to nil if not assigned to a constant"
fails "Class#dup retains the correct ancestor chain for the singleton class"
fails "Class#dup retains an included module in the ancestor chain for the singleton class"
fails "Class#allocate returns a fully-formed instance of Module"
fails "Class#dup duplicates both the class and the singleton class"

fails "Class#initialize raises a TypeError when called on already initialized classes"
fails "Class#dup retains an included module in the ancestor chain for the singleton class"
fails "Class#dup retains the correct ancestor chain for the singleton class"
fails "Class#dup sets the name from the class to nil if not assigned to a constant"
fails "Class#dup stores the new name if assigned to a constant"
fails "Class#initialize raises a TypeError when called on BasicObject"
fails "Class#initialize raises a TypeError when called on already initialized classes"
fails "Class#initialize when given the Class raises a TypeError"

fails "Class.new raises a TypeError if passed a metaclass"
fails "Class#new passes the block to #initialize"

fails "Class#superclass for a singleton class of a class returns the singleton class of its superclass"
fails "Class.new raises a TypeError if passed a metaclass"
end
Loading