opal 1.8.0.alpha1 → 1.8.0.beta1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. checksums.yaml +4 -4
  2. data/.eslintrc.js +1 -0
  3. data/README.md +7 -7
  4. data/UNRELEASED.md +14 -0
  5. data/docs/releasing.md +8 -16
  6. data/lib/opal/cli_runners/chrome.rb +5 -1
  7. data/lib/opal/nodes/closure.rb +15 -7
  8. data/lib/opal/nodes/defined.rb +1 -1
  9. data/lib/opal/nodes/literal.rb +10 -6
  10. data/lib/opal/nodes/rescue.rb +1 -1
  11. data/lib/opal/simple_server.rb +2 -2
  12. data/lib/opal/version.rb +1 -1
  13. data/opal/corelib/array.rb +39 -21
  14. data/opal/corelib/class.rb +26 -8
  15. data/opal/corelib/complex.rb +1 -1
  16. data/opal/corelib/constants.rb +2 -2
  17. data/opal/corelib/enumerator/arithmetic_sequence.rb +1 -1
  18. data/opal/corelib/error.rb +10 -0
  19. data/opal/corelib/hash.rb +30 -18
  20. data/opal/corelib/kernel.rb +0 -1
  21. data/opal/corelib/module.rb +44 -5
  22. data/opal/corelib/number.rb +28 -1
  23. data/opal/corelib/range.rb +1 -1
  24. data/opal/corelib/rational.rb +1 -1
  25. data/opal/corelib/runtime.js +124 -42
  26. data/opal/corelib/string.rb +36 -8
  27. data/opal/corelib/struct.rb +1 -1
  28. data/opal/corelib/time.rb +1 -1
  29. data/spec/filters/bugs/array.rb +58 -0
  30. data/spec/filters/bugs/basicobject.rb +7 -0
  31. data/spec/filters/bugs/bigdecimal.rb +1 -2
  32. data/spec/filters/bugs/binding.rb +1 -0
  33. data/spec/filters/bugs/class.rb +2 -3
  34. data/spec/filters/bugs/complex.rb +3 -0
  35. data/spec/filters/bugs/date.rb +5 -2
  36. data/spec/filters/bugs/datetime.rb +1 -0
  37. data/spec/filters/bugs/delegate.rb +1 -2
  38. data/spec/filters/bugs/encoding.rb +1 -1
  39. data/spec/filters/bugs/enumerable.rb +11 -0
  40. data/spec/filters/bugs/enumerator.rb +15 -2
  41. data/spec/filters/bugs/exception.rb +9 -4
  42. data/spec/filters/bugs/file.rb +2 -0
  43. data/spec/filters/bugs/float.rb +1 -0
  44. data/spec/filters/bugs/freeze.rb +5 -49
  45. data/spec/filters/bugs/hash.rb +1 -0
  46. data/spec/filters/bugs/integer.rb +5 -6
  47. data/spec/filters/bugs/kernel.rb +12 -5
  48. data/spec/filters/bugs/language.rb +33 -15
  49. data/spec/filters/bugs/marshal.rb +63 -4
  50. data/spec/filters/bugs/method.rb +2 -10
  51. data/spec/filters/bugs/module.rb +18 -7
  52. data/spec/filters/bugs/objectspace.rb +2 -0
  53. data/spec/filters/bugs/pathname.rb +1 -0
  54. data/spec/filters/bugs/proc.rb +4 -2
  55. data/spec/filters/bugs/random.rb +0 -3
  56. data/spec/filters/bugs/range.rb +1 -1
  57. data/spec/filters/bugs/rational.rb +2 -0
  58. data/spec/filters/bugs/refinement.rb +19 -0
  59. data/spec/filters/bugs/regexp.rb +27 -5
  60. data/spec/filters/bugs/ruby-32.rb +0 -4
  61. data/spec/filters/bugs/set.rb +10 -2
  62. data/spec/filters/bugs/singleton.rb +0 -2
  63. data/spec/filters/bugs/string.rb +140 -1
  64. data/spec/filters/bugs/struct.rb +15 -5
  65. data/spec/filters/bugs/time.rb +56 -2
  66. data/spec/filters/bugs/trace_point.rb +1 -0
  67. data/spec/filters/bugs/unboundmethod.rb +4 -9
  68. data/spec/filters/bugs/warnings.rb +0 -1
  69. data/spec/filters/platform/firefox/exception.rb +3 -3
  70. data/spec/filters/platform/firefox/kernel.rb +1 -0
  71. data/spec/filters/platform/safari/exception.rb +2 -2
  72. data/spec/filters/platform/safari/float.rb +1 -0
  73. data/spec/filters/platform/safari/kernel.rb +1 -0
  74. data/spec/filters/platform/safari/literal_regexp.rb +2 -2
  75. data/spec/filters/unsupported/hash.rb +1 -1
  76. data/spec/lib/compiler_spec.rb +4 -0
  77. data/spec/opal/core/class/clone_spec.rb +36 -0
  78. data/spec/opal/core/object_id_spec.rb +0 -6
  79. data/spec/opal/language/predefined_spec.rb +20 -0
  80. data/spec/opal/language/yield_spec.rb +43 -0
  81. data/spec/ruby_specs +0 -2
  82. data/stdlib/bigdecimal.rb +2 -0
  83. data/stdlib/delegate.rb +3 -4
  84. data/stdlib/pathname.rb +1 -1
  85. data/stdlib/promise/v2.rb +22 -7
  86. data/stdlib/stringio.rb +2 -0
  87. data/tasks/testing.rake +15 -11
  88. data/test/opal/promisev2/test_always.rb +14 -0
  89. data/test/opal/unsupported_and_bugs.rb +0 -8
  90. metadata +10 -6
@@ -4,9 +4,8 @@ opal_filter "language" do
4
4
  fails "$LOAD_PATH.resolve_feature_path returns what will be loaded without actual loading, .rb file" # NoMethodError: undefined method `resolve_feature_path' for []
5
5
  fails "$LOAD_PATH.resolve_feature_path returns what will be loaded without actual loading, .so file" # NoMethodError: undefined method `resolve_feature_path' for []
6
6
  fails "A Proc taking |*a, **kw| arguments does not autosplat keyword arguments" # Expected [[1], {"a"=>1}] == [[[1, {"a"=>1}]], {}] to be truthy but was false
7
- fails "A Symbol literal with invalid bytes raises an EncodingError at parse time" # Expected EncodingError (/invalid/) but no exception was raised ("Ã" was returned)
7
+ fails "A Symbol literal raises an EncodingError at parse time when Symbol with invalid bytes" # Expected EncodingError (invalid symbol in encoding UTF-8 :"\xC3") but no exception was raised ("Ã" was returned)
8
8
  fails "A block yielded a single Array assigns elements to mixed argument types" # Expected [1, 2, [], 3, 2, {"x"=>9}] == [1, 2, [3], {"x"=>9}, 2, {}] to be truthy but was false
9
- fails "A block yielded a single Array autosplats single argument to required arguments when a keyword rest argument is present" # ArgumentError: expected kwargs
10
9
  fails "A block yielded a single Array does not call #to_hash on final argument to get keyword arguments and does not autosplat" # ArgumentError: expected kwargs
11
10
  fails "A block yielded a single Array does not call #to_hash on the argument when optional argument and keyword argument accepted and does not autosplat" # ArgumentError: expected kwargs
12
11
  fails "A block yielded a single Array does not call #to_hash on the last element if keyword arguments are present" # ArgumentError: expected kwargs
@@ -57,6 +56,8 @@ opal_filter "language" do
57
56
  fails "Allowed characters allows non-ASCII lowercased characters at the beginning" # Expected nil == 1 to be truthy but was false
58
57
  fails "Allowed characters allows not ASCII upcased characters at the beginning" # NameError: wrong constant name ἍBB
59
58
  fails "Allowed characters parses a non-ASCII upcased character as a constant identifier" # Expected SyntaxError (/dynamic constant assignment/) but no exception was raised ("test" was returned)
59
+ fails "An Exception reaching the top level kills all threads and fibers, ensure clauses are only run for threads current fibers, not for suspended fibers with ensure on non-root fiber" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x29a62>
60
+ fails "An Exception reaching the top level kills all threads and fibers, ensure clauses are only run for threads current fibers, not for suspended fibers with ensure on the root fiber" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x29a62>
60
61
  fails "An ensure block inside 'do end' block is executed even when a symbol is thrown in it's corresponding begin block" # Expected ["begin", "rescue", "ensure"] == ["begin", "ensure"] to be truthy but was false
61
62
  fails "An ensure block inside a begin block is executed even when a symbol is thrown in it's corresponding begin block" # Expected ["begin", "rescue", "ensure"] == ["begin", "ensure"] to be truthy but was false
62
63
  fails "An ensure block inside a class is executed even when a symbol is thrown" # Expected ["class", "rescue", "ensure"] == ["class", "ensure"] to be truthy but was false
@@ -67,8 +68,10 @@ opal_filter "language" do
67
68
  fails "An instance method with a default argument evaluates the default when required arguments precede it" # Expected ArgumentError (wrong number of arguments (given 0, expected 1..2)) but got: ArgumentError ([MSpecEnv#foo] wrong number of arguments (given 0, expected -2))
68
69
  fails "An instance method with a default argument prefers to assign to a default argument before a splat argument" # Expected ArgumentError (wrong number of arguments (given 0, expected 1+)) but got: ArgumentError ([MSpecEnv#foo] wrong number of arguments (given 0, expected -2))
69
70
  fails "Assigning an anonymous module to a constant sets the name of a module scoped by an anonymous module" # NoMethodError: undefined method `end_with?' for nil
71
+ fails "Evaluation order during assignment with multiple assignment can be used to swap variables with nested method calls" # Expected #<VariablesSpecs::EvalOrder::Node:0x95bdc @right= #<VariablesSpecs::EvalOrder::Node:0x95bd8 @left=#<VariablesSpecs::EvalOrder::Node:0x95bdc ...>>> == #<VariablesSpecs::EvalOrder::Node:0x95bd8 @left= #<VariablesSpecs::EvalOrder::Node:0x95bdc @right=#<VariablesSpecs::EvalOrder::Node:0x95bd8 ...>>> to be truthy but was false
72
+ fails "Evaluation order during assignment with multiple assignment evaluates from left to right, receivers first then methods" # Expected ["a", "b", "foo", "foo[]=", "bar", "bar.baz="] == ["foo", "bar", "a", "b", "foo[]=", "bar.baz="] to be truthy but was false
73
+ fails "Evaluation order during assignment with single assignment evaluates from left to right" # Expected ["a", "foo", "foo[]="] == ["foo", "a", "foo[]="] to be truthy but was false
70
74
  fails "Executing break from within a block raises LocalJumpError when converted into a proc during a a super call" # Expected LocalJumpError but no exception was raised (1 was returned)
71
- fails "Executing break from within a block works when passing through a super call" # Expected to not get Exception
72
75
  fails "Execution variable $: default $LOAD_PATH entries until sitelibdir included have @gem_prelude_index set" # Expected [].include? nil to be truthy but was false
73
76
  fails "Execution variable $: is initialized to an array of strings" # Expected false == true to be truthy but was false
74
77
  fails "Execution variable $: is read-only" # Expected NameError but no exception was raised ([] was returned)
@@ -91,6 +94,8 @@ opal_filter "language" do
91
94
  fails "Hash literal checks duplicated float keys on initialization" # Expected warning to match: /key 1.0 is duplicated|duplicated key/ but got: ""
92
95
  fails "Hash literal checks duplicated keys on initialization" # Expected warning to match: /key 1000 is duplicated|duplicated key/ but got: ""
93
96
  fails "Hash literal expands a BasicObject using ** into the containing Hash literal initialization" # NoMethodError: undefined method `respond_to?' for #<BasicObject:0xab798>
97
+ fails "Hash literal raises an EncodingError at parse time when Symbol key with invalid bytes and 'key: value' syntax used" # Expected EncodingError (invalid symbol in encoding UTF-8 :"\xC3") but no exception was raised ({"Ã"=>1} was returned)
98
+ fails "Hash literal raises an EncodingError at parse time when Symbol key with invalid bytes" # Expected EncodingError (invalid symbol in encoding UTF-8 :"\xC3") but no exception was raised ({"Ã"=>1} was returned)
94
99
  fails "Heredoc string allow HEREDOC with <<\"identifier\", interpolated" # Expected #<Encoding:UTF-8> == #<Encoding:US-ASCII> to be truthy but was false
95
100
  fails "Heredoc string allows HEREDOC with <<'identifier', no interpolation" # Expected #<Encoding:UTF-8> == #<Encoding:US-ASCII> to be truthy but was false
96
101
  fails "Heredoc string allows HEREDOC with <<-'identifier', allowing to indent identifier, no interpolation" # Expected #<Encoding:UTF-8> == #<Encoding:US-ASCII> to be truthy but was false
@@ -110,7 +115,6 @@ opal_filter "language" do
110
115
  fails "Keyword arguments delegation works with (*args, **kwargs)" # Expected [[], {}] == [[{}], {}] to be truthy but was false
111
116
  fails "Keyword arguments delegation works with (...)" # Expected [[], {}] == [[{}], {}] to be truthy but was false
112
117
  fails "Keyword arguments delegation works with -> (*args, **kwargs) {}" # Expected [[], {}] == [[{}], {}] to be truthy but was false
113
- fails "Keyword arguments delegation works with call(*ruby2_keyword_args) with missing ruby2_keywords in between due to CRuby bug #18625" # Expected [[], {}] == [[{}], {}] to be truthy but was false
114
118
  fails "Keyword arguments delegation works with call(*ruby2_keyword_args)" # Expected [[], {}] == [[{}], {}] to be truthy but was false
115
119
  fails "Keyword arguments delegation works with proc { |*args, **kwargs| }" # Expected [[], {}] == [[{}], {}] to be truthy but was false
116
120
  fails "Keyword arguments delegation works with super(*ruby2_keyword_args)" # Expected [[], {}] == [[{}], {}] to be truthy but was false
@@ -124,7 +128,6 @@ opal_filter "language" do
124
128
  fails "Keyword arguments raises ArgumentError for missing keyword arguments even if there are extra ones" # Expected ArgumentError (/missing keyword: :a/) but got: ArgumentError (missing keyword: a)
125
129
  fails "Literal (A::X) constant resolution uses the module or class #inspect to craft the error message if they are anonymous" # Expected NameError (/uninitialized constant <unusable info>::DOES_NOT_EXIST/) but got: NameError (uninitialized constant #<Module:0x913b2>::DOES_NOT_EXIST)
126
130
  fails "Literal (A::X) constant resolution uses the module or class #name to craft the error message" # Expected NameError (/uninitialized constant ModuleName::DOES_NOT_EXIST/) but got: NameError (uninitialized constant #<Module:0x913aa>::DOES_NOT_EXIST)
127
- fails "Literal (A::X) constant resolution with dynamically assigned constants evaluates the right hand side before evaluating a constant path" # NameError: uninitialized constant #<Module:0x91556>::ConstantSpecsRHS
128
131
  fails "Literal Ranges creates a simple range as an object literal" # Expected 1..3.equal? 1..3 to be truthy but was false
129
132
  fails "Literal Regexps caches the Regexp object" # Expected /foo/ to be identical to /foo/
130
133
  fails "Literal Regexps support handling unicode 9.0 characters with POSIX bracket expressions" # Expected "" == "𐓘" to be truthy but was false
@@ -207,7 +210,9 @@ opal_filter "language" do
207
210
  fails "Pattern matching Hash pattern does not match object if #deconstruct_keys method returns Hash with non-symbol keys" # Expected true == false to be truthy but was false
208
211
  fails "Pattern matching Hash pattern raise SyntaxError when keys duplicate in pattern" # Expected SyntaxError (/duplicated key name/) but got: SyntaxError (duplicate hash pattern key a)
209
212
  fails "Pattern matching alternative pattern does not support variable binding" # Expected SyntaxError (/illegal variable in alternative pattern/) but no exception was raised (nil was returned)
213
+ fails "Pattern matching can be standalone assoc operator that deconstructs value and properly scopes variables" # Expected [nil, nil] == [0, nil] to be truthy but was false
210
214
  fails "Pattern matching cannot mix in and when operators" # Expected SyntaxError (/syntax error, unexpected `in'/) but got: SyntaxError (unexpected token kIN)
215
+ fails "Pattern matching raises NoMatchingPatternError if no pattern matches and evaluates the expression only once" # Expected NoMatchingPatternError (/\[0, 1\]/) but got: NoMethodError (undefined method `+' for nil)
211
216
  fails "Pattern matching refinements are used for #=== in constant pattern" # NoMatchingPatternError: {}
212
217
  fails "Pattern matching refinements are used for #deconstruct" # NoMatchingPatternError: []
213
218
  fails "Pattern matching refinements are used for #deconstruct_keys" # NoMatchingPatternError: {}
@@ -226,7 +231,7 @@ opal_filter "language" do
226
231
  fails "Predefined global $. can be assigned a Float" # Expected 123.5 == 123 to be truthy but was false
227
232
  fails "Predefined global $. raises TypeError if object can't be converted to an Integer" # Expected TypeError but no exception was raised (#<MockObject:0xa7e2c @name="bad-value", @null=nil> was returned)
228
233
  fails "Predefined global $. should call #to_int to convert the object to an Integer" # Expected #<MockObject:0xa7fde @name="good-value", @null=nil> == 321 to be truthy but was false
229
- fails "Predefined global $/ changes $-0" # Expected nil to be identical to "xyz"
234
+ fails "Predefined global $/ changes $-0" # Expected nil to be identical to "xyz"
230
235
  fails "Predefined global $/ does not call #to_str to convert the object to a String" # Expected TypeError but no exception was raised (#<MockObject>(#pretty_inspect raised #<TypeError: can't convert MockObject into String (MockObject#to_str gives NilClass)>) was returned)
231
236
  fails "Predefined global $/ raises a TypeError if assigned a boolean" # Expected TypeError but no exception was raised (#<TrueClass>(#pretty_inspect raised #<TypeError: no implicit conversion of TrueClass into String>) was returned)
232
237
  fails "Predefined global $/ raises a TypeError if assigned an Integer" # Expected TypeError but no exception was raised (#<Number>(#pretty_inspect raised #<TypeError: no implicit conversion of Number into String>) was returned)
@@ -242,6 +247,7 @@ opal_filter "language" do
242
247
  fails "Predefined global $~ raises an error if assigned an object not nil or instanceof MatchData" # Expected TypeError but no exception was raised (#<Object:0xa73aa> was returned)
243
248
  fails "Ruby String interpolation returns a string with the source encoding by default" # Expected #<Encoding:UTF-8> == #<Encoding:ASCII-8BIT> to be truthy but was false
244
249
  fails "Ruby String interpolation returns a string with the source encoding, even if the components have another encoding" # ArgumentError: unknown encoding name - euc-jp
250
+ fails "Source files encoded in UTF-16 LE without a BOM are parsed as empty because they contain a NUL byte before the encoding comment" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x9a8a0>
245
251
  fails "The ** operator hash with omitted value accepts mixed syntax" # NameError: uninitialized constant MSpecEnv::a
246
252
  fails "The ** operator hash with omitted value accepts short notation 'key' for 'key: value' syntax" # NameError: uninitialized constant MSpecEnv::a
247
253
  fails "The ** operator hash with omitted value ignores hanging comma on short notation" # NameError: uninitialized constant MSpecEnv::a
@@ -251,9 +257,19 @@ opal_filter "language" do
251
257
  fails "The BEGIN keyword runs in a shared scope" # SyntaxError: Unsupported sexp: preexe
252
258
  fails "The BEGIN keyword runs multiple begins in FIFO order" # SyntaxError: Unsupported sexp: preexe
253
259
  fails "The BEGIN keyword uses top-level for self" # SyntaxError: Unsupported sexp: preexe
254
- fails "The END keyword runs last in a given code unit" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x193ae>
255
- fails "The END keyword runs multiple ends in LIFO order" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x193ae>
260
+ fails "The END keyword END blocks and at_exit callbacks are mixed runs them all in reverse order of registration" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x5bfd0 @method="END" @object=nil>
261
+ fails "The END keyword allows calling exit inside a handler" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x5bfd0 @method="END" @object=nil>
262
+ fails "The END keyword both exceptions in a handler and in the main script are printed" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x5bfd0 @method="END" @object=nil>
263
+ fails "The END keyword calls the nested handler right after the outer one if a handler is nested into another handler" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x5bfd0 @method="END" @object=nil>
264
+ fails "The END keyword decides the exit status if both at_exit and the main script raise SystemExit" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x5bfd0 @method="END" @object=nil>
265
+ fails "The END keyword gives access to the last raised exception - global variables $! and $@" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x5bfd0 @method="END" @object=nil>
266
+ fails "The END keyword is affected by the toplevel assignment" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x5bfd0 @method="END" @object=nil>
267
+ fails "The END keyword runs after all other code" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x5bfd0 @method="END" @object=nil>
268
+ fails "The END keyword runs all handlers even if some raise exceptions" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x5bfd0 @method="END" @object=nil>
269
+ fails "The END keyword runs handlers even if the main script fails to parse" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x5bfd0 @method="END" @object=nil>
270
+ fails "The END keyword runs in reverse order of registration" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x5bfd0 @method="END" @object=nil>
256
271
  fails "The END keyword runs only once for multiple calls" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x193ae>
272
+ fails "The END keyword warns when END is used in a method" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x5bfd0 @method="END" @object=nil>
257
273
  fails "The __ENCODING__ pseudo-variable is US-ASCII by default" # Expected #<Encoding:UTF-8> == #<Encoding:US-ASCII> to be truthy but was false
258
274
  fails "The __ENCODING__ pseudo-variable is the encoding specified by a magic comment in the file" # Expected #<Encoding:UTF-8> == #<Encoding:US-ASCII> to be truthy but was false
259
275
  fails "The __ENCODING__ pseudo-variable is the encoding specified by a magic comment inside an eval" # Expected #<Encoding:UTF-8> == #<Encoding:ASCII-8BIT> to be truthy but was false
@@ -270,14 +286,8 @@ opal_filter "language" do
270
286
  fails "The alias keyword operates on methods defined via attr, attr_reader, and attr_accessor" # NameError: undefined method `foo' for class `Object'
271
287
  fails "The alias keyword operates on the object's metaclass when used in instance_eval" # NameError: undefined method `value' for class `Object'
272
288
  fails "The alias keyword supports aliasing twice the same global variables" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x1c9ba @obj=#<AliasObject:0x1ce06> @meta=#<Class:#<AliasObject:0x1ce06>>>
273
- fails "The break statement in a captured block from a scope that has returned raises a LocalJumpError when calling the block from a method" # Expected LocalJumpError but got: Exception (unexpected break)
274
- fails "The break statement in a captured block from a scope that has returned raises a LocalJumpError when yielding to the block" # Expected LocalJumpError but got: Exception (unexpected break)
275
289
  fails "The break statement in a captured block from another thread raises a LocalJumpError when getting the value from another thread" # NotImplementedError: Thread creation not available
276
- fails "The break statement in a captured block when the invocation of the scope creating the block is still active raises a LocalJumpError when invoking the block from a method" # Expected LocalJumpError but got: Exception (unexpected break)
277
- fails "The break statement in a captured block when the invocation of the scope creating the block is still active raises a LocalJumpError when invoking the block from the scope creating the block" # Expected LocalJumpError but got: Exception (unexpected break)
278
- fails "The break statement in a captured block when the invocation of the scope creating the block is still active raises a LocalJumpError when yielding to the block" # Expected LocalJumpError but got: Exception (unexpected break)
279
290
  fails "The break statement in a lambda created at the toplevel returns a value when invoking from a block" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0xa5de4 @program=#<BreakSpecs::Lambda:0xa5ea2 @ensures=false>>
280
- fails "The break statement in a lambda created at the toplevel returns a value when invoking from a method" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0xa5de4 @program=#<BreakSpecs::Lambda:0xa5ea6 @ensures=false>>
281
291
  fails "The break statement in a lambda created at the toplevel returns a value when invoking from the toplevel" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0xa5de4 @program=#<BreakSpecs::Lambda:0xa5eaa @ensures=false>>
282
292
  fails "The class keyword does not raise a SyntaxError when opening a class without a semicolon" # NameError: uninitialized constant ClassSpecsKeywordWithoutSemicolon
283
293
  fails "The def keyword within a closure looks outside the closure for the visibility" # Expected DefSpecsLambdaVisibility to have private instance method 'some_method' but it does not
@@ -299,7 +309,11 @@ opal_filter "language" do
299
309
  fails "The defined? keyword for variables when a Regexp matches a String returns nil for non-captures" # Expected "global-variable" to be nil
300
310
  fails "The defined? keyword for variables when a String matches a Regexp returns nil for non-captures" # Expected "global-variable" to be nil
301
311
  fails "The defined? keyword for yield returns 'yield' if a block is passed to a method not taking a block parameter" # Expected false == true to be truthy but was false
312
+ fails "The defined? keyword when called with a method name having a throw in the receiver escapes defined? and performs the throw semantics as normal" # Expected nil == "unreachable" to be truthy but was false
313
+ fails "The defined? keyword when called with a method name in a void context does not execute the receiver" # Expected "defined_specs_side_effects" == "not_executed" to be truthy but was false
314
+ fails "The defined? keyword when called with a method name in a void context warns about the void context when parsing it" # Expected warning to match: /warning: possibly useless use of defined\? in void context/ but got: ""
302
315
  fails "The defined? keyword when called with a method name without a receiver returns 'method' if the method is defined" # Expected false == true to be truthy but was false
316
+ fails "The if expression when a branch syntactically does not return a value raises SyntaxError if both do not return a value" # Expected SyntaxError (/void value expression/) but no exception was raised ("m" was returned)
303
317
  fails "The if expression with a boolean range ('flip-flop' operator) evaluates the first conditions lazily with exclusive-end range" # NoMethodError: undefined method `collector' for #<MSpecEnv:0x7bd18>
304
318
  fails "The if expression with a boolean range ('flip-flop' operator) evaluates the first conditions lazily with inclusive-end range" # NoMethodError: undefined method `collector' for #<MSpecEnv:0x7bd18>
305
319
  fails "The redo statement in a method is invalid and raises a SyntaxError" # Expected SyntaxError but no exception was raised ("m" was returned)
@@ -310,7 +324,9 @@ opal_filter "language" do
310
324
  fails "The rescue keyword only accepts Module or Class in splatted rescue clauses" # Expected TypeError but got: RuntimeError (error)
311
325
  fails "The rescue keyword rescues the exception in the deepest rescue block declared to handle the appropriate exception type" # Expected "<internal:corelib/runtime.js>:1878:5:in `Opal.send2'" to include ":in `raise_standard_error'"
312
326
  fails "The return keyword at top level return with argument warns but does not affect exit status" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x1494e @filename=nil>
327
+ fails "The return keyword at top level within BEGIN is allowed" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x29c06>
313
328
  fails "The return keyword at top level within a block within a class is not allowed" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x1494e>
329
+ fails "The super keyword is able to navigate to super, when a method is defined dynamically on the singleton class" # Exception: Maximum call stack size exceeded
314
330
  fails "The super keyword uses block argument given to method when used in a block" # LocalJumpError: no block given
315
331
  fails "The super keyword uses given block even if arguments are passed explicitly" # LocalJumpError: no block given
316
332
  fails "The throw keyword raises an UncaughtThrowError if used to exit a thread" # NotImplementedError: Thread creation not available
@@ -326,5 +342,7 @@ opal_filter "language" do
326
342
  fails "self in a metaclass body (class << obj) raises a TypeError for symbols" # Expected TypeError but got: Exception (Cannot create property '$$meta' on string 'symbol')
327
343
  fails "self.send(:block_given?) returns false when a method defined by define_method is called with a block" # NoMethodError: undefined method `block_given?' for KernelSpecs::SelfBlockGiven
328
344
  fails "self.send(:block_given?) returns true if and only if a block is supplied" # NoMethodError: undefined method `block_given?' for KernelSpecs::SelfBlockGiven
329
- fails "top-level constant lookup on a class does not search Object after searching other scopes" # Expected NameError but no exception was raised (Hash was returned)
345
+ fails "top-level constant lookup on a class does not search Object after searching other scopes" # Expected NameError but no exception was raised (Hash was returned)
346
+ fails_badly "Executing break from within a block works when passing through a super call" # Expected to not get Exception
347
+ fails_badly "The break statement in a lambda created at the toplevel returns a value when invoking from a method" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0xa5de4 @program=#<BreakSpecs::Lambda:0xa5ea6 @ensures=false>>
330
348
  end
@@ -3,31 +3,74 @@ opal_filter "Marshal" do
3
3
  fails "Marshal.dump ignores the recursion limit if the limit is negative" # ArgumentError: [Marshal.dump] wrong number of arguments (given 2, expected 1)
4
4
  fails "Marshal.dump raises a TypeError if dumping a Mutex instance" # Expected TypeError but no exception was raised ( "\x04\bo: Mutex\x06:\f@lockedF" was returned)
5
5
  fails "Marshal.dump when passed a StringIO should raise an error" # Expected TypeError but no exception was raised ( "\x04\bo:\rStringIO :\f@string\"\x00:\x0E@positioni\x00:\b@fd0:\v@flags\"\arw:\t@eofF" was returned)
6
+ fails "Marshal.dump with a Bignum increases the object links counter" # Expected "\x04\b[\bl+ \x00\x00\x00\x00\x00\x00\x00\x00\x01\x00o:\vObject\x00@\x06" == "\u0004\b[\bl+ \u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0001\u0000o:\vObject\u0000@\a" to be truthy but was false
7
+ fails "Marshal.dump with a Class ignores overridden name method" # Expected "\x04\bc\bFoo" == "\x04\bc)MarshalSpec::ClassWithOverriddenName" to be truthy but was false
8
+ fails "Marshal.dump with a Complex dumps a Complex" # Expected "\x04\bo:\fComplex\a: @reali\a: @imagi\b" == "\x04\bU:\fComplex[\ai\ai\b" to be truthy but was false
9
+ fails "Marshal.dump with a Hash dumps a Hash subclass with compare_by_identity" # Expected "\x04\bC:\rUserHash{\x00" == "\x04\bC:\rUserHashC:\tHash{\x00" to be truthy but was false
10
+ fails "Marshal.dump with a Hash dumps a Hash with compare_by_identity" # Expected "\x04\b{\x00" == "\x04\bC:\tHash{\x00" to be truthy but was false
11
+ fails "Marshal.dump with a Hash dumps a non-empty Hash" # Expected "\x04\b{\x06\"\x06ai\x06" == "\x04\b{\x06:\x06ai\x06" to be truthy but was false
12
+ fails "Marshal.dump with a Hash ignores overridden name method when dumps a Hash subclass" # Expected "\x04\bC:\bFoo{\x00" == "\x04\bC:(MarshalSpec::HashWithOverriddenName{\x00" to be truthy but was false
13
+ fails "Marshal.dump with a Module ignores overridden name method" # Expected "\x04\bc\bFoo" == "\x04\bc*MarshalSpec::ModuleWithOverriddenName" to be truthy but was false
14
+ fails "Marshal.dump with a Range raises TypeError with an anonymous Range subclass" # Expected TypeError (/can't dump anonymous class/) but got: NoMethodError (undefined method `length' for nil)
15
+ fails "Marshal.dump with a Rational dumps a Rational" # Expected "\x04\bo:\rRational\a:\t@numi\a:\t@deni\b" == "\x04\bU:\rRational[\ai\ai\b" to be truthy but was false
6
16
  fails "Marshal.dump with a Regexp dumps a Regexp subclass" # Expected "\x04\b/\t(?:)\x00" == "\x04\bIC:\x0FUserRegexp/\x00\x00\x06:\x06EF" to be truthy but was false
7
17
  fails "Marshal.dump with a Regexp dumps a Regexp with instance variables" # Expected "\x04\bI/\t(?:)\x00\x06: @ivar\"\tivar" == "\x04\bI/\x00\x00\a:\x06EF: @ivar:\tivar" to be truthy but was false
18
+ fails "Marshal.dump with a Regexp dumps an ascii-compatible Regexp" # NameError: uninitialized constant Regexp::FIXEDENCODING
19
+ fails "Marshal.dump with a Regexp ignores overridden name method when dumps a Regexp subclass" # Expected "\x04\b/\t(?:)\x00" == "\x04\bIC:*MarshalSpec::RegexpWithOverriddenName/\x00\x00\x06:\x06EF" to be truthy but was false
20
+ fails "Marshal.dump with a String ignores overridden name method when dumps a String subclass" # Expected "\x04\bC:\bFoo\"\x00" == "\x04\bC:*MarshalSpec::StringWithOverriddenName\"\x00" to be truthy but was false
8
21
  fails "Marshal.dump with a Struct dumps an extended Struct" # Expected "\x04\be: MethsS:\x15Struct::Extended\a:\x06a[\a\"\x06a\"\ahi:\x06b[\a\" Meths@\b" == "\x04\be: MethsS:\x15Struct::Extended\a:\x06a[\a;\a\"\ahi:\x06b[\a;\x00@\a" to be truthy but was false
22
+ fails "Marshal.dump with a Struct ignores overridden name method" # Expected "\x04\bS:\bFoo\x06:\x06a\"\vmember" == "\x04\bS:*MarshalSpec::StructWithOverriddenName\x06:\x06a\"\vmember" to be truthy but was false
23
+ fails "Marshal.dump with a Struct raises TypeError with an anonymous Struct" # Expected TypeError (/can't dump anonymous class/) but got: NoMethodError (undefined method `length' for nil)
9
24
  fails "Marshal.dump with a Symbol dumps multiple Symbols sharing the same encoding" # Expected "\x04\b[\a\"\tâ\x82¬a\"\tâ\x82¬b" == "\u0004\b[\aI:\tâ\u0082¬a\u0006:\u0006ETI:\tâ\u0082¬b\u0006;\u0006T" to be truthy but was false
25
+ fails "Marshal.dump with a Time dumps a Time subclass with multibyte characters in name" # NoMethodError: undefined method `default_internal' for Encoding
10
26
  fails "Marshal.dump with a Time dumps the zone and the offset" # NoMethodError: undefined method `default_internal' for Encoding
11
27
  fails "Marshal.dump with a Time dumps the zone, but not the offset if zone is UTC" # NoMethodError: undefined method `default_internal' for Encoding
28
+ fails "Marshal.dump with a Time ignores overridden name method" # NoMethodError: undefined method `default_internal' for Encoding
29
+ fails "Marshal.dump with a Time raises TypeError with an anonymous Time subclass" # NoMethodError: undefined method `default_internal' for Encoding
30
+ fails "Marshal.dump with an Array ignores overridden name method when dumps an Array subclass" # Expected "\x04\bC:\bFoo[\x00" == "\x04\bC:)MarshalSpec::ArrayWithOverriddenName[\x00" to be truthy but was false
12
31
  fails "Marshal.dump with an Exception contains the filename in the backtrace" # Expected "\x04\bo:\x0EException\b: @name\"\x0EException:\v@cause0:\x0F@backtrace[\x06\"\x12foo/bar.rb:10" == "\x04\bo:\x0EException\a:\tmesg\"\bfoo:\abt[\x06\"\x12foo/bar.rb:10" to be truthy but was false
13
32
  fails "Marshal.dump with an Exception dumps an empty Exception" # Expected "\x04\bo:\x0EException\a: @name\"\x0EException:\v@cause0" == "\x04\bo:\x0EException\a:\tmesg0:\abt0" to be truthy but was false
14
33
  fails "Marshal.dump with an Exception dumps instance variables if they exist" # Expected "\x04\bo:\x0EException\b: @name\"\x0EException:\v@cause0: @ivari\x06" == "\x04\bo:\x0EException\b:\tmesg\"\bfoo:\abt0: @ivari\x06" to be truthy but was false
15
34
  fails "Marshal.dump with an Exception dumps the cause for the exception" # Expected "StandardError" == "the cause" to be truthy but was false
16
35
  fails "Marshal.dump with an Exception dumps the message for the exception" # Expected "\x04\bo:\x0EException\a: @name\"\x0EException:\v@cause0" == "\x04\bo:\x0EException\a:\tmesg\"\bfoo:\abt0" to be truthy but was false
36
+ fails "Marshal.dump with an Exception dumps the message for the raised NoMethodError exception" # Expected "\x04\bo:\x12NoMethodError\t: @name\"\bfoo:\v@cause0: @args[\x00:\x0F@backtrace[)\"=ruby/core/marshal/dump_spec.rb:739:11:in `instance_exec'\"@<internal:corelib/basic_object.rb>:126:1:in `instance_exec'\".mspec/runner/mspec.rb:117:11:in `protect'\"-mspec/runner/context.rb:176:39:in `$$17'\"4<internal:corelib/enumerable.rb>:28:16:in `$$3'\"0<internal:corelib/array.rb>:976:1:in `each'\"E<internal:corelib/enumerable.rb>:27:7:in `Enumerable_all$ques$1'\"0mspec/runner/context.rb:176:18:in `protect'\"-mspec/runner/context.rb:212:26:in `$$21'\",mspec/runner/mspec.rb:285:7:in `repeat'\"-mspec/runner/context.rb:204:16:in `$$20'\"0<internal:corelib/array.rb>:976:1:in `each'\"0mspec/runner/context.rb:203:18:in `process'\"-mspec/runner/context.rb:235:34:in `$$23'\"0<internal:corelib/array.rb>:976:1:in `each'\"0mspec/runner/context.rb:235:13:in `process'\".mspec/runner/mspec.rb:56:10:in `describe'\"/mspec/runner/object.rb:11:10:in `describe'\"Uruby/core/marshal/dump_spec.rb:6:1:in `Opal.modules.ruby/core/marshal/dump_spec'\"1<internal:corelib/kernel.rb>:591:6:in `load'\"4mspec/runner/mspec.rb:100:42:in `instance_exec'\"@<internal:corelib/basic_object.rb>:126:1:in `instance_exec'\".mspec/runner/mspec.rb:117:11:in `protect'\")mspec/runner/mspec.rb:100:7:in `$$1'\"0<internal:corelib/array.rb>:976:1:in `each'\"/mspec/runner/mspec.rb:91:12:in `each_file'\"*mspec/runner/mspec.rb:96:5:in `files'\",mspec/runner/mspec.rb:64:5:in `process'\".tmp/mspec_nodejs.rb:3975:6:in `undefined'\"&tmp/mspec_nodejs.rb:1:1:in `null'\"Bnode:internal/modules/cjs/loader:1241:14:in `Module._compile'\"Inode:internal/modules/cjs/loader:1295:10:in `Module._extensions..js'\">node:internal/modules/cjs/loader:1091:32:in `Module.load'\">node:internal/modules/cjs/loader:938:12:in `Module._load'\"Dnode:internal/modules/run_main:83:12:in `executeUserEntryPoint'\"<node:internal/main/run_main_module:23:47:in `undefined'" =~ /undefined method `foo' for ("":String|an instance of String)/ to be truthy but was nil
37
+ fails "Marshal.dump with an Exception raises TypeError if an Object is an instance of an anonymous class" # Expected TypeError (/can't dump anonymous class/) but got: NoMethodError (undefined method `length' for nil)
17
38
  fails "Marshal.dump with an Object dumps a BasicObject subclass if it defines respond_to?" # NoMethodError: undefined method `object_id' for #<MarshalSpec::BasicObjectSubWithRespondToFalse:0x8585e>
18
39
  fails "Marshal.dump with an Object dumps an Object with a non-US-ASCII instance variable" # NameError: '@é' is not allowed as an instance variable name
19
- fails "Marshal.dump with an Object raises if an Object has a singleton class and singleton methods" # Expected TypeError (singleton can't be dumped) but no exception was raised ("\x04\bo:\vObject\x00" was returned)
20
- fails "Marshal.dump with an object responding to #_dump dumps the object returned by #marshal_dump" # Expected "\x04\bu:\x10UserDefined\x12\x04\b[\a\" stuff@\x06" == "\x04\bu:\x10UserDefined\x12\x04\b[\a: stuff;\x00" to be truthy but was false
40
+ fails "Marshal.dump with an Object ignores overridden name method" # Expected "\x04\bo:\bFoo\x00" == "\x04\bo:)MarshalSpec::ClassWithOverriddenName\x00" to be truthy but was false
41
+ fails "Marshal.dump with an Object raises TypeError if an Object extends an anonymous module" # Expected TypeError (/can't dump anonymous class/) but got: NoMethodError (undefined method `length' for nil)
42
+ fails "Marshal.dump with an Object raises TypeError if an Object has a singleton class and singleton instance variables" # Expected TypeError (singleton can't be dumped) but no exception was raised ("\x04\bo:\vObject\x00" was returned)
43
+ fails "Marshal.dump with an Object raises TypeError if an Object has a singleton class and singleton methods" # Expected TypeError (singleton can't be dumped) but no exception was raised ("\x04\bo:\vObject\x00" was returned)
44
+ fails "Marshal.dump with an Object raises TypeError if an Object is an instance of an anonymous class" # Expected TypeError (/can't dump anonymous class/) but got: NoMethodError (undefined method `length' for nil)
45
+ fails "Marshal.dump with an object responding to #_dump Core library classes with #_dump returning a String with instance variables indexes instance variables and then a Time object itself" # Expected "\x04\b[\ao:\tTime\x06:\x0E@timezonei\x00@\x06" == "\u0004\b[\aIu:\tTime\r \u0080\u001EÀ\u0000\u0000\u0000\u0000\u0006:\tzoneI\"\bUTC\u0006:\u0006EF@\a" to be truthy but was false
46
+ fails "Marshal.dump with an object responding to #_dump dumps the String in multibyte encoding" # Expected "\x04\bu:\x16UserDefinedString\x06a" == "\x04\bIu:\x16UserDefinedString\ta\x00\x00\x00\x06:\rencoding\"\rUTF-32LE" to be truthy but was false
47
+ fails "Marshal.dump with an object responding to #_dump dumps the String in non US-ASCII and non UTF-8 encoding" # ArgumentError: unknown encoding name - windows-1251
48
+ fails "Marshal.dump with an object responding to #_dump dumps the String returned by #_dump" # Expected "\x04\bu:\x10UserDefined\x17\x04\b[\a\" stuff\" stuff" == "\x04\bu:\x10UserDefined\x12\x04\b[\a: stuff;\x00" to be truthy but was false
49
+ fails "Marshal.dump with an object responding to #_dump ignores overridden name method" # Expected "\x04\bu:\bFoo\x17\x04\b[\a\" stuff\" stuff" == "\x04\bu:/MarshalSpec::UserDefinedWithOverriddenName\x12\x04\b[\a: stuff;\x00" to be truthy but was false
50
+ fails "Marshal.dump with an object responding to #_dump indexes instance variables of a String returned by #_dump at first and then indexes the object itself" # Expected "\x04\b[\au:\x17MarshalSpec::M1::A\v<dump>u:\x17MarshalSpec::M1::A\v<dump>" == "\u0004\b[\aIu:\u0017MarshalSpec::M1::A\v<dump>\u0006:\t@foo\"\bbar@\a" to be truthy but was false
51
+ fails "Marshal.dump with an object responding to #_dump raises TypeError if an Object is an instance of an anonymous class" # Expected TypeError (/can't dump anonymous class/) but got: NoMethodError (undefined method `length' for nil)
52
+ fails "Marshal.dump with an object responding to #marshal_dump raises TypeError if an Object is an instance of an anonymous class" # Expected TypeError (/can't dump anonymous class/) but got: Exception (Cannot read properties of undefined (reading '$equal?'))
53
+ fails "Marshal.load for a Complex loads" # Expected (4+3i).frozen? to be truthy but was false
54
+ fails "Marshal.load for a Hash preserves compare_by_identity behaviour for a Hash subclass" # Expected {}.compare_by_identity? to be truthy but was false
55
+ fails "Marshal.load for a Hash preserves compare_by_identity behaviour" # Expected {"a"=>1}.compare_by_identity? to be truthy but was false
21
56
  fails "Marshal.load for a Module loads an old module" # NotImplementedError: ModuleOld type cannot be demarshaled yet
22
- fails "Marshal.load for a Regexp loads a extended_user_regexp having ivar" # Expected [Meths, Regexp, Object] == [Meths, UserRegexp, Regexp] to be truthy but was false
57
+ fails "Marshal.load for a Rational loads" # Expected (1/3).frozen? to be truthy but was false
58
+ fails "Marshal.load for a Regexp loads a Regexp subclass instance variables when it is extended with a module" # Expected [Meths, Regexp, Object] == [Meths, UserRegexp, Regexp] to be truthy but was false
23
59
  fails "Marshal.load for a Regexp loads an extended Regexp" # Expected /[a-z]/ == /(?:)/ to be truthy but was false
60
+ fails "Marshal.load for a Regexp preserves Regexp encoding" # NoMethodError: undefined method `encoding' for /a/
61
+ fails "Marshal.load for a Regexp raises ArgumentError when end of byte sequence reached before source string end" # Expected "\x04\b/\x10hello world\x00" == "\x04\bI/\x10hello world\x00\x06:\x06EF" to be truthy but was false
24
62
  fails "Marshal.load for a String loads a String as BINARY if no encoding is specified at the end" # Expected #<Encoding:UTF-8> == #<Encoding:ASCII-8BIT> to be truthy but was false
25
63
  fails "Marshal.load for a String loads a String subclass with custom constructor" # ArgumentError: [UserCustomConstructorString#initialize] wrong number of arguments (given 1, expected 2)
64
+ fails "Marshal.load for a String sets binmode if it is loading through StringIO stream" # Expected RuntimeError (binmode) but got: TypeError (incompatible marshal file format (can't be read))
26
65
  fails "Marshal.load for a Struct does not call initialize on the unmarshaled struct" # Expected ["foo"] == nil to be truthy but was false
27
66
  fails "Marshal.load for a Symbol loads a Symbol" # Expected #<Encoding:UTF-8> == #<Encoding:US-ASCII> to be truthy but was false
28
67
  fails "Marshal.load for a Symbol loads a binary encoded Symbol" # Expected "â\u0086\u0092" == "→" to be truthy but was false
29
68
  fails "Marshal.load for a Symbol loads an encoded Symbol" # Expected "â\u0086\u0092" == "→" to be truthy but was false
30
- fails "Marshal.load for a Time loads nanoseconds" # NoMethodError: undefined method `nsec' for 2022-12-07 05:35:14 +0100
69
+ fails "Marshal.load for a Symbol raises ArgumentError when end of byte sequence reached before symbol characters end" # Expected "\x04\b\" hello" == "\x04\b: hello" to be truthy but was false
70
+ fails "Marshal.load for a Time keeps nanoseconds" # NoMethodError: undefined method `nsec' for 2023-09-20 22:51:57 +0200
71
+ fails "Marshal.load for a Time keeps the local zone" # Expected "Central European Summer Time" == "Central European Standard Time" to be truthy but was false
72
+ fails "Marshal.load for a Time keeps the zone" # Expected "Central European Summer Time" == "AST" to be truthy but was false
73
+ fails "Marshal.load for a Time keeps utc offset" # Expected 540 == 32400 to be truthy but was false
31
74
  fails "Marshal.load for a Time loads" # Expected 2022-12-07 05:35:14 +0100 == 1970-01-01 01:00:01 +0100 to be truthy but was false
32
75
  fails "Marshal.load for a user object that extends a core type other than Object or BasicObject raises ArgumentError if the resulting class does not extend the same type" # Expected ArgumentError but got: TypeError (no implicit conversion of Hash into Integer)
33
76
  fails "Marshal.load for an Exception loads a marshalled exception with a backtrace" # Expected "Exception" == "foo" to be truthy but was false
@@ -40,10 +83,26 @@ opal_filter "Marshal" do
40
83
  fails "Marshal.load loads an array containing objects having _dump method, and with proc" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1)
41
84
  fails "Marshal.load loads an array containing objects having marshal_dump method, and with proc" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1)
42
85
  fails "Marshal.load when a class does not exist in the namespace raises an ArgumentError" # Expected ArgumentError (undefined class/module NamespaceTest::SameName) but no exception was raised (#<SameName:0x89b06> was returned)
86
+ fails "Marshal.load when called on objects with custom _dump methods loads the String in non US-ASCII and non UTF-8 encoding" # ArgumentError: unknown encoding name - windows-1251
87
+ fails "Marshal.load when called with a proc call the proc with extended objects" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1)
43
88
  fails "Marshal.load when called with a proc call the proc with fully initialized strings" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1)
44
89
  fails "Marshal.load when called with a proc calls the proc for recursively visited data" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1)
45
90
  fails "Marshal.load when called with a proc loads an Array with proc" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1)
46
91
  fails "Marshal.load when called with a proc no longer mutate the object after it was passed to the proc" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1)
47
92
  fails "Marshal.load when called with a proc returns the value of the proc" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1)
93
+ fails "Marshal.load when called with freeze: true deep freezing deduplicates frozen strings" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1)
94
+ fails "Marshal.load when called with freeze: true deep freezing returns arrays with frozen elements" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1)
95
+ fails "Marshal.load when called with freeze: true deep freezing returns hashes with frozen keys and values" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1)
96
+ fails "Marshal.load when called with freeze: true deep freezing returns objects with frozen instance variables" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1)
97
+ fails "Marshal.load when called with freeze: true deep freezing returns structs with frozen members" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1)
98
+ fails "Marshal.load when called with freeze: true does freeze extended objects with instance variables" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1)
99
+ fails "Marshal.load when called with freeze: true does freeze extended objects" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1)
100
+ fails "Marshal.load when called with freeze: true does not call freeze method" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1)
101
+ fails "Marshal.load when called with freeze: true returns a frozen object when is an instance of String/Array/Regexp/Hash subclass and has instance variables" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1)
102
+ fails "Marshal.load when called with freeze: true returns frozen object even if object does not respond to freeze method" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1)
103
+ fails "Marshal.load when called with freeze: true returns frozen object extended by a module" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1)
104
+ fails "Marshal.load when called with freeze: true returns frozen object having #_dump method" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1)
105
+ fails "Marshal.load when called with freeze: true returns frozen object responding to #marshal_dump and #marshal_load" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1)
106
+ fails "Marshal.load when called with freeze: true returns frozen structs" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1)
48
107
  fails "Marshal.load when called with nil for the proc argument behaves as if no proc argument was passed" # ArgumentError: [Marshal.load] wrong number of arguments (given 2, expected 1)
49
108
  end
@@ -27,7 +27,6 @@ opal_filter "Method" do
27
27
  fails "Method#curry with optional arity argument raises ArgumentError when the method requires less arguments than the given arity" # Expected ArgumentError but no exception was raised (#<Proc:0x7c68a> was returned)
28
28
  fails "Method#curry with optional arity argument raises ArgumentError when the method requires more arguments than the given arity" # Expected ArgumentError but no exception was raised (#<Proc:0x7c66a> was returned)
29
29
  fails "Method#define_method when passed a Proc object and a method is defined inside defines the nested method in the default definee where the Proc was created" # Expected #<#<Class:0x51aa0>:0x51a9c> NOT to have method 'nested_method_in_proc_for_define_method' but it does
30
- fails "Method#define_method when passed a block behaves exactly like a lambda for break" # Exception: unexpected break
31
30
  fails "Method#define_method when passed an UnboundMethod object defines a method with the same #arity as the original" # Expected -1 == -3 to be truthy but was false
32
31
  fails "Method#define_method when passed an UnboundMethod object defines a method with the same #parameters as the original" # Expected [["rest", "args"]] == [["req", "a"], ["req", "b"], ["rest", "c"]] to be truthy but was false
33
32
  fails "Method#eql? missing methods returns true for the same method missing" # NameError: undefined method `handled_via_method_missing' for class `MethodSpecs::Methods'
@@ -51,18 +50,10 @@ opal_filter "Method" do
51
50
  fails "Method#parameters returns [[:rest]] for a Method generated by respond_to_missing?" # NameError: undefined method `handled_via_method_missing' for class `MethodSpecs::Methods'
52
51
  fails "Method#parameters returns [[:rest]] for core methods with variable-length argument lists" # NameError: undefined method `delete!' for class `String'
53
52
  fails "Method#parameters returns [[:rest]] or [[:opt]] for core methods with optional arguments" # Expected [[["rest"]], [["opt"]]] to include [["opt", "count"]]
54
- fails "Method#private? returns false when the method is protected" # NoMethodError: undefined method `private?' for #<Method: MethodSpecs::Methods#my_protected_method (defined in MethodSpecs::Methods in ruby/core/method/fixtures/classes.rb:88)>
55
- fails "Method#private? returns false when the method is public" # NoMethodError: undefined method `private?' for #<Method: MethodSpecs::Methods#my_public_method (defined in MethodSpecs::Methods in ruby/core/method/fixtures/classes.rb:87)>
56
- fails "Method#private? returns true when the method is private" # NoMethodError: undefined method `private?' for #<Method: MethodSpecs::Methods#my_private_method (defined in MethodSpecs::Methods in ruby/core/method/fixtures/classes.rb:89)>
57
- fails "Method#protected? returns false when the method is private" # NoMethodError: undefined method `protected?' for #<Method: MethodSpecs::Methods#my_private_method (defined in MethodSpecs::Methods in ruby/core/method/fixtures/classes.rb:89)>
58
- fails "Method#protected? returns false when the method is public" # NoMethodError: undefined method `protected?' for #<Method: MethodSpecs::Methods#my_public_method (defined in MethodSpecs::Methods in ruby/core/method/fixtures/classes.rb:87)>
59
- fails "Method#protected? returns true when the method is protected" # NoMethodError: undefined method `protected?' for #<Method: MethodSpecs::Methods#my_protected_method (defined in MethodSpecs::Methods in ruby/core/method/fixtures/classes.rb:88)>
60
- fails "Method#public? returns false when the method is private" # NoMethodError: undefined method `public?' for #<Method: MethodSpecs::Methods#my_private_method (defined in MethodSpecs::Methods in ruby/core/method/fixtures/classes.rb:89)>
61
- fails "Method#public? returns false when the method is protected" # NoMethodError: undefined method `public?' for #<Method: MethodSpecs::Methods#my_protected_method (defined in MethodSpecs::Methods in ruby/core/method/fixtures/classes.rb:88)>
62
- fails "Method#public? returns true when the method is public" # NoMethodError: undefined method `public?' for #<Method: MethodSpecs::Methods#my_public_method (defined in MethodSpecs::Methods in ruby/core/method/fixtures/classes.rb:87)>
63
53
  fails "Method#receiver for a Method generated by respond_to_missing? returns the receiver of the method" # NameError: undefined method `handled_via_method_missing' for class `MethodSpecs::Methods'
64
54
  fails "Method#source_location for a Method generated by respond_to_missing? returns nil" # NameError: undefined method `handled_via_method_missing' for class `MethodSpecs::Methods'
65
55
  fails "Method#source_location sets the first value to the path of the file in which the method was defined" # Expected "ruby/core/method/fixtures/classes.rb" == "./ruby/core/method/fixtures/classes.rb" to be truthy but was false
56
+ fails "Method#source_location works for eval with a given line" # Expected ["(eval)", 0] == ["foo", 100] to be truthy but was false
66
57
  fails "Method#source_location works for methods defined with an UnboundMethod" # Expected "<internal:corelib/module.rb>" =~ /ruby\/core\/method\/source_location_spec.rb/ to be truthy but was nil
67
58
  fails "Method#super_method after aliasing an inherited method returns the expected super_method" # NoMethodError: undefined method `super_method' for #<Method: MethodSpecs::InheritedMethods::C#meow (defined in MethodSpecs::InheritedMethods::C in ruby/core/method/fixtures/classes.rb:233)>
68
59
  fails "Method#super_method after changing an inherited methods visibility returns the expected super_method" # NoMethodError: undefined method `super_method' for #<Method: MethodSpecs::InheritedMethods::C#derp (defined in MethodSpecs::InheritedMethods::B in ruby/core/method/fixtures/classes.rb:233)>
@@ -83,4 +74,5 @@ opal_filter "Method" do
83
74
  fails "Method#to_s shows the metaclass and the owner for a Module instance method retrieved from a class" # Expected "#<Method: Class#include (defined in Module in <internal:corelib/module.rb>:464)>".start_with? "#<Method: #<Class:String>(Module)#include" to be truthy but was false
84
75
  fails "Method#unbind keeps the origin singleton class if there is one" # Expected "#<UnboundMethod: Object#foo (defined in #<Class:#<Object:0x30684>> in ruby/core/method/unbind_spec.rb:37)>".start_with? "#<UnboundMethod: #<Class:#<Object:0x30684>>#foo" to be truthy but was false
85
76
  fails "Method#unbind rebinding UnboundMethod to Method's obj produces exactly equivalent Methods" # Expected #<Method: MethodSpecs::Methods#foo (defined in MethodSpecs::Methods in ruby/core/method/fixtures/classes.rb:24)> == #<Method: MethodSpecs::Methods#foo (defined in MethodSpecs::Methods in ruby/core/method/fixtures/classes.rb:24)> to be truthy but was false
77
+ fails_badly "Method#define_method when passed a block behaves exactly like a lambda for break" # Exception: unexpected break
86
78
  end
@@ -37,6 +37,7 @@ opal_filter "Module" do
37
37
  fails "Module#class_eval resolves constants in the caller scope" # NameError: uninitialized constant ModuleSpecs::ClassEvalTest::Lookup
38
38
  fails "Module#class_eval uses the optional filename and lineno parameters for error messages" # Expected ["test", 1] == ["test", 102] to be truthy but was false
39
39
  fails "Module#class_variables returns the correct class variables when inherit is given" # ArgumentError: [SubCVars.class_variables] wrong number of arguments (given 1, expected 0)
40
+ fails "Module#const_added records re-definition of existing constants" # Expected warning to match: /warning: already initialized constant .+::TEST/ but got: ""
40
41
  fails "Module#const_defined? coerces the inherit flag to a boolean" # Expected true to be false
41
42
  fails "Module#const_defined? returns true for toplevel constant when the name begins with '::'" # Expected false to be true
42
43
  fails "Module#const_defined? returns true or false for the nested name" # Expected false == true to be truthy but was false
@@ -82,9 +83,12 @@ opal_filter "Module" do
82
83
  fails "Module#const_source_location with statically assigned constants searches location path the immediate class or module first" # NoMethodError: undefined method `const_source_location' for ConstantSpecs::ClassA
83
84
  fails "Module#const_source_location with statically assigned constants searches location path the superclass before a module included in the superclass" # NoMethodError: undefined method `const_source_location' for ConstantSpecs::ContainerA::ChildA
84
85
  fails "Module#const_source_location with statically assigned constants searches location path the superclass chain" # NoMethodError: undefined method `const_source_location' for ConstantSpecs::ContainerA::ChildA
86
+ fails "Module#const_source_location with statically assigned constants works for the module and class keywords" # NoMethodError: undefined method `const_source_location' for ConstantSpecs
87
+ fails "Module#const_source_location works for eval with a given line" # NoMethodError: undefined method `const_source_location' for #<Class:0x2f66a>
85
88
  fails "Module#constants doesn't returns inherited constants when passed nil" # Expected ["CS_CONST10", "CS_CONST10_LINE", "CS_CONST23", "CS_CONST24", "CS_CONST5", "ChildA"] == ["CS_CONST10", "CS_CONST10_LINE", "CS_CONST23", "CS_CONST5", "ChildA"] to be truthy but was false
86
89
  fails "Module#constants returns only public constants" # Expected ["PRIVATE_CONSTANT", "PUBLIC_CONSTANT"] == ["PUBLIC_CONSTANT"] to be truthy but was false
87
90
  fails "Module#define_method converts non-String name to String with #to_str" # NoMethodError: undefined method `foo' for #<#<Class:0x33ce6>:0x33ce4>
91
+ fails "Module#define_method defines the new method according to the scope visibility when a Method passed and the class/module of the context is equal to the receiver of #define_method" # Expected NoMethodError but no exception was raised (nil was returned)
88
92
  fails "Module#define_method passed { |a,| } creates a method that does not destructure the passed argument" # Expected [1, 2] == 1 to be truthy but was false
89
93
  fails "Module#define_method raises TypeError if name cannot converted to String" # Expected TypeError (/is not a symbol nor a string/) but no exception was raised (#<Class:0x33da2> was returned)
90
94
  fails "Module#define_method raises TypeError when #to_str called on non-String name returns non-String value" # Expected TypeError (/can't convert Object to String/) but no exception was raised (#<Class:0x33d52> was returned)
@@ -104,12 +108,11 @@ opal_filter "Module" do
104
108
  fails "Module#extend_object extends the given object with its constants and methods by default" # NoMethodError: undefined method `test_method' for #<MockObject:0x2541a @name="extended direct" @null=nil>
105
109
  fails "Module#extend_object on Class raises a TypeError if calling after rebinded to Class" # Expected TypeError but no exception was raised (nil was returned)
106
110
  fails "Module#include doesn't accept no-arguments" # Expected ArgumentError but no exception was raised (#<Module:0xdd44> was returned)
107
- fails "Module#initialize_copy should produce a duped module with inspectable class methods" # NameError: undefined method `hello' for class `Module'
108
- fails "Module#initialize_copy should retain singleton methods when duped" # Expected [] == ["hello"] to be truthy but was false
109
111
  fails "Module#instance_method converts non-String name by calling #to_str method" # NameError: undefined method `#<Object:0x3a942>' for class `ModuleSpecs::InstanceMeth'
110
112
  fails "Module#instance_method raises TypeError when passed non-String name and #to_str returns non-String value" # Expected TypeError (/can't convert Object to String/) but got: NameError (undefined method `#<Object:0x3a98e>' for class `ModuleSpecs::InstanceMeth')
111
113
  fails "Module#instance_method raises a NameError if the method has been undefined" # Expected #<UnboundMethod: ModuleSpecs::InstanceMeth#foo (defined in ModuleSpecs::InstanceMeth in ruby/core/module/fixtures/classes.rb:319)> == #<UnboundMethod: ModuleSpecs::InstanceMeth#foo (defined in ModuleSpecs::InstanceMeth in ruby/core/module/fixtures/classes.rb:319)> to be truthy but was false
112
114
  fails "Module#instance_method raises a TypeError if the given name is not a String/Symbol" # Expected TypeError (/is not a symbol nor a string/) but got: NameError (undefined method `' for class `Object')
115
+ fails "Module#method_added is called when using #private in a subclass" # Expected [] == ["foo"] to be truthy but was false
113
116
  fails "Module#method_added is called with a precise caller location with the line of the 'def'" # Expected [110, 110] == [74, 77] to be truthy but was false
114
117
  fails "Module#method_defined? converts the given name to a string using to_str" # Expected false == true to be truthy but was false
115
118
  fails "Module#method_defined? raises a TypeError when the given object is not a string/symbol" # Expected TypeError but no exception was raised (false was returned)
@@ -137,8 +140,7 @@ opal_filter "Module" do
137
140
  fails "Module#name is not nil for a nested module created with the module keyword" # Expected nil =~ /^#<Module:0x[0-9a-f]+>::N$/ to be truthy but was false
138
141
  fails "Module#name is not nil when assigned to a constant in an anonymous module" # NoMethodError: undefined method `end_with?' for nil
139
142
  fails "Module#name is set after it is removed from a constant under an anonymous module" # Expected nil =~ /^#<Module:0x\h+>::Child$/ to be truthy but was false
140
- fails "Module#prepend keeps the module in the chain when dupping the class" # Exception: self.$$constructor is not a constructor
141
- fails "Module#prepend uses only new module when dupping the module" # Expected [#<Module:0xa8270>] == [#<Module:0xa8282>, #<Module:0xa8270>] to be truthy but was false
143
+ fails "Module#prepend prepends a module if it is included in a super class" # RuntimeError: Prepending a module multiple times is not supported
142
144
  fails "Module#private with argument array as a single argument sets visibility of given method names" # Expected #<Module:0x3bf72> to have private instance method 'test1' but it does not
143
145
  fails "Module#private with argument one or more arguments sets visibility of given method names" # Expected #<Module:0x3bf6c> to have private instance method 'test1' but it does not
144
146
  fails "Module#private_class_method when single argument is passed and is an array sets the visibility of the given methods to private" # Expected NoMethodError but no exception was raised ("foo" was returned)
@@ -165,17 +167,18 @@ opal_filter "Module" do
165
167
  fails "Module#refine for methods accessed indirectly is honored by Symbol#to_proc" # Expected ["1", "2", "3"] == ["(1)", "(2)", "(3)"] to be truthy but was false
166
168
  fails "Module#refine for methods accessed indirectly is honored by string interpolation" # Expected "1" == "foo" to be truthy but was false
167
169
  fails "Module#refine makes available all refinements from the same module" # NoMethodError: undefined method `to_json_format' for {1=>2}
168
- fails "Module#refine method lookup looks in the included modules for builtin methods" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x3cece>
169
170
  fails "Module#refine method lookup looks in the object singleton class first" # Expected "foo from refinement" == "foo from singleton class" to be truthy but was false
170
171
  fails "Module#refine module inclusion activates all refinements from all ancestors" # NoMethodError: undefined method `to_json_format' for 5
171
172
  fails "Module#refine module inclusion overrides methods of ancestors by methods in descendants" # NoMethodError: undefined method `to_json_format' for 5
172
173
  fails "Module#refine raises ArgumentError if not given a block" # Expected ArgumentError but got: LocalJumpError (no block given)
173
174
  fails "Module#refine raises TypeError if not passed a class" # Expected TypeError but got: Exception (Cannot create property '$$id' on string 'foo')
175
+ fails "Module#refinements does not return refinements defined in the included module" # Expected {String=>#<refinement:String@#<Module:0x6530c>>} == [#<refinement:String@#<Module:0x6530c>>] to be truthy but was false
176
+ fails "Module#refinements returns an empty array if no refinements defined in a module" # Expected {} == [] to be truthy but was false
177
+ fails "Module#refinements returns refinements defined in a module" # Expected [[String, #<refinement:String@#<Module:0x65354>>], [Array, #<refinement:Array@#<Module:0x65354>>]] == [#<refinement:String@#<Module:0x65354>>, #<refinement:Array@#<Module:0x65354>>] to be truthy but was false
174
178
  fails "Module#remove_const calls #to_str to convert the given name to a String" # Mock 'CS_CONST257' expected to receive to_str("any_args") exactly 1 times but received it 0 times
175
179
  fails "Module#remove_const raises a TypeError if conversion to a String by calling #to_str fails" # Expected TypeError but got: NameError (constant ConstantSpecs::ConstantSpecs not defined)
176
180
  fails "Module#ruby2_keywords accepts String as well" # Expected false == true to be truthy but was false
177
181
  fails "Module#ruby2_keywords applies to the underlying method and applies across aliasing" # Expected false == true to be truthy but was false
178
- fails "Module#ruby2_keywords does NOT copy the Hash when calling a method taking (*args)" # Expected false == true to be truthy but was false
179
182
  fails "Module#ruby2_keywords makes a copy and unmark the Hash when calling a method taking (**kw)" # Expected false == true to be truthy but was false
180
183
  fails "Module#ruby2_keywords makes a copy and unmark the Hash when calling a method taking (arg)" # Expected false == true to be truthy but was false
181
184
  fails "Module#ruby2_keywords makes a copy of the hash and only marks the copy as keyword hash" # Expected false == true to be truthy but was false
@@ -195,6 +198,10 @@ opal_filter "Module" do
195
198
  fails "Module#undef_method raises a NameError when passed a missing name for a metaclass" # Expected NameError (/undefined method `not_exist' for class `String'/) but got: NameError (method 'not_exist' not defined in )
196
199
  fails "Module#undef_method raises a NameError when passed a missing name for a module" # Expected NameError (/undefined method `not_exist' for module `#<Module:0x121a6>'/) but got: NameError (method 'not_exist' not defined in )
197
200
  fails "Module#undef_method raises a NameError when passed a missing name for a singleton class" # Expected NameError (/undefined method `not_exist' for class `#<Class:#<:0x121c2>>'/) but got: NameError (method 'not_exist' not defined in )
201
+ fails "Module#undefined_instance_methods does not returns ancestors undefined methods" # NoMethodError: undefined method `undefined_instance_methods' for ModuleSpecs::UndefinedInstanceMethods::Grandchild
202
+ fails "Module#undefined_instance_methods returns inherited methods undefined in the class" # NoMethodError: undefined method `undefined_instance_methods' for ModuleSpecs::UndefinedInstanceMethods::Child
203
+ fails "Module#undefined_instance_methods returns methods from an included module that are undefined in the class" # NoMethodError: undefined method `undefined_instance_methods' for ModuleSpecs::UndefinedInstanceMethods::Grandchild
204
+ fails "Module#undefined_instance_methods returns methods undefined in the class" # NoMethodError: undefined method `undefined_instance_methods' for ModuleSpecs::UndefinedInstanceMethods::Parent
198
205
  fails "Module#using does not accept class" # Expected TypeError but no exception was raised (#<Module:0x3a10e> was returned)
199
206
  fails "Module#using imports class refinements from module into the current class/module" # NoMethodError: undefined method `foo' for 1
200
207
  fails "Module#using raises TypeError if passed something other than module" # Expected TypeError but no exception was raised (#<Module:0x3a124> was returned)
@@ -202,7 +209,11 @@ opal_filter "Module" do
202
209
  fails "Module#using scope of refinement is active for block called via instance_exec" # NoMethodError: undefined method `foo' for 1
203
210
  fails "Module#using scope of refinement is active for class defined via Class.new {}" # NoMethodError: undefined method `foo' for 1
204
211
  fails "Module#using scope of refinement is active for module defined via Module.new {}" # NoMethodError: undefined method `foo' for 1
205
- fails "Module#using works in classes too" # NoMethodError: undefined method `foo' for 1
212
+ fails "Module#using works in classes too" # NoMethodError: undefined method `foo' for 1
213
+ fails "Module.used_refinements ignores refinements imported in a module that is included into the current one" # NoMethodError: undefined method `used_refinements' for Module
214
+ fails "Module.used_refinements returns empty array if does not have any refinements imported" # NoMethodError: undefined method `used_refinements' for Module
215
+ fails "Module.used_refinements returns list of all refinements imported in the current scope" # NoMethodError: undefined method `used_refinements' for Module
216
+ fails "Module.used_refinements returns refinements even not defined directly in a module refinements are imported from" # NoMethodError: undefined method `used_refinements' for Module
206
217
  fails_badly "Module#ancestors returns a list of modules included in self (including self)" # Expected [ModuleSpecs::Parent, Object, Shellwords, Kernel, BasicObject] == [ModuleSpecs::Parent, Object, Kernel, BasicObject] to be truthy but was false -- a random failure
207
218
  fails_badly "Module#refine for methods accessed indirectly is honored by Kernel#instance_method" # NameError: undefined method `foo' for class `'
208
219
  fails_badly "Module#refine for methods accessed indirectly is honored by Kernel#method" # NameError: undefined method `foo' for class `#<Class:0x581e4>'
@@ -19,6 +19,8 @@ opal_filter "ObjectSpace" do
19
19
  fails "ObjectSpace.define_finalizer warns if the finalizer has the object as the receiver" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x36f5c>
20
20
  fails "ObjectSpace.define_finalizer warns if the finalizer is a method bound to the receiver" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x36f5c>
21
21
  fails "ObjectSpace.define_finalizer warns if the finalizer was a block in the receiver" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x36f5c>
22
+ fails "ObjectSpace.define_finalizer when $VERBOSE is nil does not warn even if an exception is raised in finalizer" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x6e408>
23
+ fails "ObjectSpace.define_finalizer when $VERBOSE is not nil warns if an exception is raised in finalizer" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x6e408>
22
24
  fails "ObjectSpace.each_object calls the block once for each class, module in the Ruby process" # NoMethodError: undefined method `each_object' for ObjectSpace
23
25
  fails "ObjectSpace.each_object calls the block once for each living, non-immediate object in the Ruby process" # NoMethodError: undefined method `each_object' for ObjectSpace
24
26
  fails "ObjectSpace.each_object finds an object captured in an at_exit handler" # NoMethodError: undefined method `each_object' for ObjectSpace
@@ -4,6 +4,7 @@ opal_filter "Pathname" do
4
4
  fails "Pathname#inspect returns a consistent String" # Expected "#<Pathname:0x1e50 @path=\"/tmp\">" == "#<Pathname:/tmp>" to be truthy but was false
5
5
  fails "Pathname#realdirpath returns a Pathname" # NoMethodError: undefined method `realdirpath' for #<Pathname:0x1380 @path=".">
6
6
  fails "Pathname#realpath returns a Pathname" # NoMethodError: undefined method `realpath' for #<Pathname:0xaa902 @path=".">
7
+ fails "Pathname#relative_path_from converts string argument to Pathname" # NoMethodError: undefined method `cleanpath' for "/usr"
7
8
  fails "Pathname#relative_path_from raises an error when the base directory has .." # Expected ArgumentError but no exception was raised ("a" was returned)
8
9
  fails "Pathname#relative_path_from raises an error when the two paths do not share a common prefix" # Expected ArgumentError but no exception was raised ("../usr" was returned)
9
10
  fails "Pathname#relative_path_from returns current and pattern when only those patterns are used" # Expected "." == ".." to be truthy but was false
@@ -23,8 +23,10 @@ opal_filter "Proc" do
23
23
  fails "Proc#call can call its block argument declared with a block argument" # Expected 6 == 10 to be truthy but was false
24
24
  fails "Proc#call on a Proc created with Kernel#lambda or Kernel#proc ignores excess arguments when self is a proc" # ArgumentError: expected kwargs
25
25
  fails "Proc#call yields to the block given at declaration and not to the block argument" # Expected 3 == 7 to be truthy but was false
26
+ fails "Proc#clone returns an instance of subclass" # Expected Proc == #<Class:0x71d98> to be truthy but was false
26
27
  fails "Proc#curry with arity argument returns Procs with arities of -1 regardless of the value of _arity_" # ArgumentError: wrong number of arguments (3 for 1)
27
28
  fails "Proc#curry with arity argument returns a Proc if called on a lambda that requires fewer than _arity_ arguments but may take more" # ArgumentError: wrong number of arguments (4 for 5)
29
+ fails "Proc#dup returns an instance of subclass" # Expected Proc == #<Class:0x8f364> to be truthy but was false
28
30
  fails "Proc#eql? is a public method" # Expected Proc to have public instance method 'eql?' but it does not
29
31
  fails "Proc#eql? returns true if other is a dup of the original" # Expected false to be true
30
32
  fails "Proc#inspect for a proc created with Proc.new has a binary encoding" # Expected #<Encoding:UTF-8> == #<Encoding:ASCII-8BIT> to be truthy but was false
@@ -48,6 +50,7 @@ opal_filter "Proc" do
48
50
  fails "Proc#source_location returns the same value for a proc-ified method as the method reports" # Expected ["ruby/core/proc/fixtures/source_location.rb", 3] == nil to be truthy but was false
49
51
  fails "Proc#source_location sets the first value to the path of the file in which the proc was defined" # Expected "ruby/core/proc/fixtures/source_location.rb" == "./ruby/core/proc/fixtures/source_location.rb" to be truthy but was false
50
52
  fails "Proc#source_location sets the last value to an Integer representing the line on which the proc was defined" # NoMethodError: undefined method `last' for nil
53
+ fails "Proc#source_location works for eval with a given line" # Expected nil == ["foo", 100] to be truthy but was false
51
54
  fails "Proc#to_s for a proc created with Proc.new has a binary encoding" # Expected #<Encoding:UTF-8> == #<Encoding:ASCII-8BIT> to be truthy but was false
52
55
  fails "Proc#to_s for a proc created with Proc.new returns a description including file and line number" # Expected "#<Proc:0x5813e>" =~ /^#<Proc:([^ ]*?) ruby\/core\/proc\/shared\/to_s\.rb:4>$/ to be truthy but was nil
53
56
  fails "Proc#to_s for a proc created with Symbol#to_proc has a binary encoding" # Expected #<Encoding:UTF-8> == #<Encoding:ASCII-8BIT> to be truthy but was false
@@ -69,7 +72,6 @@ opal_filter "Proc" do
69
72
  fails "Proc.new with an associated block called on a subclass of Proc that does not 'super' in 'initialize' still constructs a functional proc" # NoMethodError: undefined method `ok' for #<Proc:0x3fc56>
70
73
  fails "Proc.new with an associated block called on a subclass of Proc using a reified block parameter returns an instance of the subclass" # Expected Proc == #<Class:0x3fc3e> to be truthy but was false
71
74
  fails "Proc.new with an associated block calls initialize on the Proc object" # ArgumentError: [MyProc2.new] wrong number of arguments (given 2, expected 0)
72
- fails "Proc.new with an associated block raises a LocalJumpError when context of the block no longer exists" # Expected LocalJumpError but got: Exception (unexpected return)
73
75
  fails "Proc.new with an associated block returns a subclass of Proc" # Expected #<Proc:0x3fbfc> (Proc) to be kind of ProcSpecs::MyProc
74
- fails "Proc.new without a block raises an ArgumentError when passed no block" # Expected ArgumentError (tried to create Proc object without a block) but got: ArgumentError (tried to create a Proc object without a block)
76
+ fails "Proc.new without a block raises an ArgumentError when passed no block" # Expected ArgumentError (tried to create Proc object without a block) but got: ArgumentError (tried to create a Proc object without a block)
75
77
  end
@@ -4,9 +4,6 @@ opal_filter "Random" do
4
4
  fails "Random#bytes returns the same numeric output for a given seed across all implementations and platforms" # Expected "ç\x16" == "\x14\\" to be truthy but was false
5
5
  fails "Random#rand with Range returns a float within a given float range" # Expected 51 == 37.454011884736246 to be truthy but was false
6
6
  fails "Random#rand with Range supports custom object types" # Expected "NaN#<struct RandomSpecs::CustomRangeInteger value=1>" (String) to be an instance of RandomSpecs::CustomRangeInteger
7
- fails "Random::DEFAULT changes seed on reboot" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x24f62>
8
- fails "Random::DEFAULT is deprecated" # Expected #<Random:0x158 @seed=32102, @state=3547213637002595>.equal? Random to be truthy but was false
9
- fails "Random::DEFAULT refers to the Random class" # Expected #<Random:0x158 @seed=32102, @state=3547213637002595>.equal? Random to be truthy but was false
10
7
  fails "SecureRandom.random_number generates a random float number between 0.0 and 1.0 if argument is negative float" # ArgumentError: invalid argument - -11.1
11
8
  fails "SecureRandom.random_number generates a random float number between 0.0 and 1.0 if argument is negative" # ArgumentError: invalid argument - -10
12
9
  fails "SecureRandom.random_number raises ArgumentError if the argument is non-numeric" # Expected ArgumentError but got: TypeError (no implicit conversion of Object into Integer)
@@ -61,7 +61,7 @@ opal_filter "Range" do
61
61
  fails "Range#first raises a TypeError if #to_int does not return an Integer" # Expected TypeError but no exception was raised ([2] was returned)
62
62
  fails "Range#frozen? is true for Range.new" # Expected 1..2.frozen? to be truthy but was false
63
63
  fails "Range#frozen? is true for literal ranges" # Expected 1..2.frozen? to be truthy but was false
64
- fails "Range#hash generates an Integer for the hash value" # Expected "A,1,1,0" (String) to be an instance of Integer
64
+ fails "Range#include? does not include U+9995 in the range U+0999..U+9999" # Expected true to be false
65
65
  fails "Range#include? on string elements returns false if other is not matched by element.succ" # Expected true to be false
66
66
  fails "Range#include? with weird succ when excluded end value returns false if other is not matched by element.succ" # Expected true to be false
67
67
  fails "Range#include? with weird succ when included end value returns false if other is equal as last element but not matched by element.succ" # Expected true to be false
@@ -11,4 +11,6 @@ opal_filter "Rational" do
11
11
  fails "Rational#to_r fails when a BasicObject's to_r does not return a Rational" # Expected TypeError but got: NoMethodError (undefined method `nil?' for #<BasicObject:0x182c8>)
12
12
  fails "Rational#to_r raises TypeError trying to convert BasicObject" # Expected TypeError but got: NoMethodError (undefined method `nil?' for #<BasicObject:0x182d0>)
13
13
  fails "Rational#to_r works when a BasicObject has to_r" # NoMethodError: undefined method `nil?' for #<BasicObject:0x182d8>
14
+ fails "Rational#truncate with an invalid value for precision does not call to_int on the argument" # Expected TypeError (not an integer) but got: TypeError (not an Integer)
15
+ fails "Rational#truncate with an invalid value for precision raises a TypeError" # Expected TypeError (not an integer) but got: TypeError (not an Integer)
14
16
  end
@@ -0,0 +1,19 @@
1
+ # NOTE: run bin/format-filters after changing this file
2
+ opal_filter "refinement" do
3
+ fails "Refinement#import_methods doesn't import any methods if one of the arguments is not a module" # Expected TypeError but got: NoMethodError (undefined method `import_methods' for #<refinement:String@#<Module:0x42ca2>>)
4
+ fails "Refinement#import_methods doesn't import methods from included/prepended modules" # NoMethodError: undefined method `import_methods' for #<refinement:String@#<Module:0x42cb0>>
5
+ fails "Refinement#import_methods doesn't import module's class methods" # NoMethodError: undefined method `import_methods' for #<refinement:String@#<Module:0x42cbc>>
6
+ fails "Refinement#import_methods imports methods from module so that methods can see each other" # NoMethodError: undefined method `import_methods' for #<refinement:String@#<Module:0x42cb6>>
7
+ fails "Refinement#import_methods imports methods from multiple modules so that methods see other's module's methods" # NoMethodError: undefined method `import_methods' for #<refinement:String@#<Module:0x42caa>>
8
+ fails "Refinement#import_methods imports module methods with super" # NoMethodError: undefined method `import_methods' for #<refinement:#<Class:0x42c8c>@#<Module:0x42c90>>
9
+ fails "Refinement#import_methods warns if a module includes/prepends some other module" # NoMethodError: undefined method `import_methods' for #<refinement:String@#<Module:0x42c9a>>
10
+ fails "Refinement#import_methods when methods are defined in Ruby code imports a method defined in the last module if method with same name is defined in multiple modules" # NoMethodError: undefined method `import_methods' for #<refinement:String@#<Module:0x42cd2>>
11
+ fails "Refinement#import_methods when methods are defined in Ruby code imports methods from multiple modules" # NoMethodError: undefined method `import_methods' for #<refinement:String@#<Module:0x42ccc>>
12
+ fails "Refinement#import_methods when methods are defined in Ruby code imports methods" # NoMethodError: undefined method `import_methods' for #<refinement:String@#<Module:0x42ce2>>
13
+ fails "Refinement#import_methods when methods are defined in Ruby code still imports methods of modules listed before a module that contains method not defined in Ruby" # Expected ArgumentError but got: NoMethodError (undefined method `import_methods' for #<refinement:String@#<Module:0x42cc4>>)
14
+ fails "Refinement#import_methods when methods are defined in Ruby code throws an exception when argument is not a module" # Expected TypeError (wrong argument type Class (expected Module)) but got: NoMethodError (undefined method `import_methods' for #<refinement:String@#<Module:0x42cda>>)
15
+ fails "Refinement#import_methods when methods are not defined in Ruby code raises ArgumentError when importing methods from C extension" # Expected ArgumentError (/Can't import method which is not defined with Ruby code: Zlib#*/) but got: NameError (uninitialized constant Zlib)
16
+ fails "Refinement#import_methods when methods are not defined in Ruby code raises ArgumentError" # Expected ArgumentError but got: NoMethodError (undefined method `import_methods' for #<refinement:String@#<Module:0x42cf0>>)
17
+ fails "Refinement#include raises a TypeError" # Expected TypeError (Refinement#include has been removed) but no exception was raised (#<refinement:String@#<Module:0x43ea8>> was returned)
18
+ fails "Refinement#prepend raises a TypeError" # Expected TypeError (Refinement#prepend has been removed) but no exception was raised (#<refinement:String@#<Module:0x2ee12>> was returned)
19
+ end