opal 1.3.2 → 1.4.0.alpha1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (222) hide show
  1. checksums.yaml +4 -4
  2. data/.eslintrc.js +1 -0
  3. data/.github/workflows/build.yml +0 -3
  4. data/.rubocop.yml +5 -1
  5. data/UNRELEASED.md +66 -2
  6. data/benchmark-ips/bm_truthy.rb +30 -0
  7. data/bin/opal-mspec +1 -3
  8. data/bin/opal-repl +1 -2
  9. data/bin/remove-filters +1 -4
  10. data/docs/compiled_ruby.md +10 -6
  11. data/exe/opal-repl +1 -3
  12. data/lib/opal/ast/builder.rb +1 -1
  13. data/lib/opal/cli.rb +2 -2
  14. data/lib/opal/cli_runners/nodejs.rb +9 -2
  15. data/lib/opal/cli_runners/source-map-support-browser.js +80 -216
  16. data/lib/opal/cli_runners/source-map-support-node.js +80 -216
  17. data/lib/opal/cli_runners/source-map-support.js +5 -1
  18. data/lib/opal/cli_runners/system_runner.rb +10 -4
  19. data/lib/opal/compiler.rb +3 -5
  20. data/lib/opal/fragment.rb +5 -1
  21. data/lib/opal/nodes/args/extract_block_arg.rb +1 -8
  22. data/lib/opal/nodes/args/extract_kwoptarg.rb +1 -3
  23. data/lib/opal/nodes/args/extract_optarg.rb +1 -3
  24. data/lib/opal/nodes/args/extract_post_arg.rb +2 -5
  25. data/lib/opal/nodes/args/extract_post_optarg.rb +2 -7
  26. data/lib/opal/nodes/args/initialize_iterarg.rb +1 -3
  27. data/lib/opal/nodes/args/prepare_post_args.rb +5 -1
  28. data/lib/opal/nodes/base.rb +3 -2
  29. data/lib/opal/nodes/call.rb +20 -9
  30. data/lib/opal/nodes/call_special.rb +50 -0
  31. data/lib/opal/nodes/class.rb +24 -15
  32. data/lib/opal/nodes/constants.rb +23 -5
  33. data/lib/opal/nodes/def.rb +20 -23
  34. data/lib/opal/nodes/defined.rb +5 -5
  35. data/lib/opal/nodes/definitions.rb +2 -2
  36. data/lib/opal/nodes/defs.rb +2 -5
  37. data/lib/opal/nodes/helpers.rb +48 -18
  38. data/lib/opal/nodes/if.rb +109 -8
  39. data/lib/opal/nodes/iter.rb +23 -16
  40. data/lib/opal/nodes/literal.rb +18 -4
  41. data/lib/opal/nodes/logic.rb +2 -1
  42. data/lib/opal/nodes/masgn.rb +4 -9
  43. data/lib/opal/nodes/module.rb +29 -19
  44. data/lib/opal/nodes/node_with_args.rb +1 -7
  45. data/lib/opal/nodes/scope.rb +54 -15
  46. data/lib/opal/nodes/singleton_class.rb +5 -3
  47. data/lib/opal/nodes/super.rb +3 -3
  48. data/lib/opal/nodes/top.rb +34 -31
  49. data/lib/opal/nodes/variables.rb +2 -2
  50. data/lib/opal/nodes/x_string.rb +3 -0
  51. data/lib/opal/nodes.rb +0 -1
  52. data/lib/opal/parser/patch.rb +75 -0
  53. data/lib/opal/parser/with_ruby_lexer.rb +1 -1
  54. data/lib/opal/regexp_anchors.rb +7 -7
  55. data/lib/opal/requires.rb +19 -0
  56. data/lib/opal/rewriters/pattern_matching.rb +1 -1
  57. data/lib/opal/rewriters/returnable_logic.rb +102 -4
  58. data/lib/opal/util.rb +2 -2
  59. data/lib/opal/version.rb +1 -1
  60. data/lib/opal.rb +1 -17
  61. data/opal/corelib/array/pack.rb +11 -11
  62. data/opal/corelib/array.rb +193 -152
  63. data/opal/corelib/basic_object.rb +14 -14
  64. data/opal/corelib/binding.rb +7 -7
  65. data/opal/corelib/boolean.rb +12 -15
  66. data/opal/corelib/class.rb +23 -1
  67. data/opal/corelib/comparable.rb +8 -8
  68. data/opal/corelib/complex/base.rb +2 -2
  69. data/opal/corelib/complex.rb +79 -88
  70. data/opal/corelib/constants.rb +9 -9
  71. data/opal/corelib/dir.rb +4 -3
  72. data/opal/corelib/enumerable.rb +140 -127
  73. data/opal/corelib/enumerator/arithmetic_sequence.rb +177 -0
  74. data/opal/corelib/enumerator/chain.rb +42 -0
  75. data/opal/corelib/enumerator/generator.rb +35 -0
  76. data/opal/corelib/enumerator/lazy.rb +243 -0
  77. data/opal/corelib/enumerator/yielder.rb +36 -0
  78. data/opal/corelib/enumerator.rb +45 -300
  79. data/opal/corelib/error/errno.rb +47 -0
  80. data/opal/corelib/error.rb +62 -60
  81. data/opal/corelib/file.rb +26 -12
  82. data/opal/corelib/hash.rb +98 -107
  83. data/opal/corelib/helpers.rb +62 -13
  84. data/opal/corelib/io.rb +47 -34
  85. data/opal/corelib/kernel/format.rb +29 -29
  86. data/opal/corelib/kernel.rb +86 -83
  87. data/opal/corelib/main.rb +14 -12
  88. data/opal/corelib/marshal/read_buffer.rb +15 -15
  89. data/opal/corelib/marshal/write_buffer.rb +45 -44
  90. data/opal/corelib/marshal.rb +3 -3
  91. data/opal/corelib/math.rb +50 -50
  92. data/opal/corelib/method.rb +12 -8
  93. data/opal/corelib/module.rb +96 -79
  94. data/opal/corelib/nil.rb +9 -11
  95. data/opal/corelib/number.rb +113 -118
  96. data/opal/corelib/numeric.rb +37 -33
  97. data/opal/corelib/object_space.rb +11 -10
  98. data/opal/corelib/pack_unpack/format_string_parser.rb +3 -3
  99. data/opal/corelib/pattern_matching/base.rb +7 -7
  100. data/opal/corelib/pattern_matching.rb +1 -1
  101. data/opal/corelib/proc.rb +15 -16
  102. data/opal/corelib/process/base.rb +2 -2
  103. data/opal/corelib/process/status.rb +21 -0
  104. data/opal/corelib/process.rb +5 -5
  105. data/opal/corelib/random/formatter.rb +11 -11
  106. data/opal/corelib/random/math_random.js.rb +1 -1
  107. data/opal/corelib/random/mersenne_twister.rb +3 -3
  108. data/opal/corelib/random/seedrandom.js.rb +3 -3
  109. data/opal/corelib/random.rb +17 -17
  110. data/opal/corelib/range.rb +51 -35
  111. data/opal/corelib/rational/base.rb +4 -4
  112. data/opal/corelib/rational.rb +61 -62
  113. data/opal/corelib/regexp.rb +47 -38
  114. data/opal/corelib/runtime.js +245 -139
  115. data/opal/corelib/string/encoding.rb +21 -21
  116. data/opal/corelib/string/unpack.rb +19 -14
  117. data/opal/corelib/string.rb +135 -128
  118. data/opal/corelib/struct.rb +59 -46
  119. data/opal/corelib/time.rb +47 -57
  120. data/opal/corelib/trace_point.rb +2 -2
  121. data/opal/corelib/unsupported.rb +31 -120
  122. data/opal/corelib/variables.rb +3 -3
  123. data/opal/opal/base.rb +9 -8
  124. data/opal/opal/full.rb +8 -8
  125. data/opal/opal/mini.rb +17 -17
  126. data/opal/opal.rb +17 -18
  127. data/opal.gemspec +1 -1
  128. data/spec/filters/bugs/array.rb +4 -24
  129. data/spec/filters/bugs/bigdecimal.rb +0 -23
  130. data/spec/filters/bugs/binding.rb +0 -1
  131. data/spec/filters/bugs/boolean.rb +3 -0
  132. data/spec/filters/bugs/class.rb +2 -0
  133. data/spec/filters/bugs/date.rb +0 -5
  134. data/spec/filters/bugs/encoding.rb +8 -50
  135. data/spec/filters/bugs/enumerable.rb +4 -1
  136. data/spec/filters/bugs/enumerator.rb +3 -36
  137. data/spec/filters/bugs/exception.rb +0 -2
  138. data/spec/filters/bugs/file.rb +0 -2
  139. data/spec/filters/bugs/float.rb +0 -3
  140. data/spec/filters/bugs/hash.rb +5 -3
  141. data/spec/filters/bugs/integer.rb +2 -3
  142. data/spec/filters/bugs/kernel.rb +2 -31
  143. data/spec/filters/bugs/language.rb +29 -49
  144. data/spec/filters/bugs/main.rb +0 -2
  145. data/spec/filters/bugs/marshal.rb +2 -3
  146. data/spec/filters/bugs/matrix.rb +0 -36
  147. data/spec/filters/bugs/module.rb +7 -61
  148. data/spec/filters/bugs/numeric.rb +0 -7
  149. data/spec/filters/bugs/objectspace.rb +1 -1
  150. data/spec/filters/bugs/pack_unpack.rb +0 -4
  151. data/spec/filters/bugs/proc.rb +0 -9
  152. data/spec/filters/bugs/random.rb +0 -5
  153. data/spec/filters/bugs/range.rb +1 -6
  154. data/spec/filters/bugs/regexp.rb +0 -3
  155. data/spec/filters/bugs/set.rb +8 -1
  156. data/spec/filters/bugs/string.rb +9 -34
  157. data/spec/filters/bugs/stringscanner.rb +8 -7
  158. data/spec/filters/bugs/struct.rb +2 -3
  159. data/spec/filters/bugs/symbol.rb +0 -1
  160. data/spec/filters/bugs/time.rb +0 -8
  161. data/spec/filters/bugs/unboundmethod.rb +0 -8
  162. data/spec/filters/bugs/warnings.rb +1 -7
  163. data/spec/filters/unsupported/freeze.rb +24 -0
  164. data/spec/filters/unsupported/integer.rb +1 -0
  165. data/spec/filters/unsupported/kernel.rb +12 -0
  166. data/spec/filters/unsupported/privacy.rb +3 -0
  167. data/spec/filters/unsupported/string.rb +2 -0
  168. data/spec/lib/builder_spec.rb +2 -2
  169. data/spec/lib/cli_spec.rb +1 -1
  170. data/spec/lib/compiler_spec.rb +37 -37
  171. data/spec/lib/simple_server_spec.rb +2 -2
  172. data/spec/lib/source_map/file_spec.rb +1 -1
  173. data/spec/opal/compiler/irb_spec.rb +2 -2
  174. data/spec/opal/core/kernel/puts_spec.rb +90 -0
  175. data/spec/opal/core/language/super_spec.rb +24 -0
  176. data/spec/ruby_specs +4 -2
  177. data/spec/support/rewriters_helper.rb +1 -1
  178. data/stdlib/bigdecimal.rb +7 -11
  179. data/stdlib/buffer/view.rb +2 -2
  180. data/stdlib/buffer.rb +2 -2
  181. data/stdlib/date.rb +5 -6
  182. data/stdlib/erb.rb +1 -0
  183. data/stdlib/js.rb +2 -1
  184. data/stdlib/native.rb +7 -8
  185. data/stdlib/nodejs/argf.rb +4 -4
  186. data/stdlib/nodejs/base.rb +29 -0
  187. data/stdlib/nodejs/dir.rb +1 -1
  188. data/stdlib/nodejs/env.rb +6 -9
  189. data/stdlib/nodejs/file.rb +23 -17
  190. data/stdlib/nodejs/fileutils.rb +3 -3
  191. data/stdlib/nodejs/io.rb +2 -20
  192. data/stdlib/nodejs/irb.rb +0 -0
  193. data/stdlib/nodejs/kernel.rb +2 -37
  194. data/stdlib/nodejs.rb +1 -3
  195. data/stdlib/opal/miniracer.rb +2 -0
  196. data/stdlib/opal/platform.rb +6 -13
  197. data/stdlib/opal/replutils.rb +16 -5
  198. data/stdlib/opal-parser.rb +2 -2
  199. data/stdlib/optparse/ac.rb +54 -0
  200. data/stdlib/optparse/date.rb +14 -0
  201. data/stdlib/optparse/kwargs.rb +22 -0
  202. data/stdlib/optparse/shellwords.rb +7 -0
  203. data/stdlib/optparse/time.rb +15 -0
  204. data/stdlib/optparse/uri.rb +7 -0
  205. data/stdlib/optparse/version.rb +69 -0
  206. data/stdlib/optparse.rb +2279 -0
  207. data/stdlib/pathname.rb +5 -6
  208. data/stdlib/pp.rb +18 -2
  209. data/stdlib/promise/v2.rb +18 -22
  210. data/stdlib/promise.rb +15 -21
  211. data/stdlib/set.rb +32 -32
  212. data/stdlib/shellwords.rb +240 -0
  213. data/stdlib/stringio.rb +3 -6
  214. data/stdlib/strscan.rb +5 -8
  215. data/stdlib/template.rb +2 -2
  216. data/stdlib/thread.rb +7 -9
  217. data/tasks/performance.rake +5 -2
  218. data/tasks/testing/mspec_special_calls.rb +0 -12
  219. data/tasks/testing.rake +55 -37
  220. data/test/nodejs/test_file.rb +11 -0
  221. metadata +55 -10
  222. data/lib/opal/nodes/case.rb +0 -114
@@ -1,29 +1,19 @@
1
1
  # NOTE: run bin/format-filters after changing this file
2
2
  opal_filter "language" do
3
- fails "$LOAD_PATH.resolve_feature_path raises LoadError if feature cannot be found" # Expected LoadError but got: NoMethodError (undefined method `resolve_feature_path' for ["foo"])
3
+ fails "$LOAD_PATH.resolve_feature_path return nil if feature cannot be found" # NoMethodError: undefined method `resolve_feature_path' for ["foo"]
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 ["foo"]
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 ["foo"]
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
6
7
  fails "A Symbol literal with invalid bytes raises an EncodingError at parse time" # Actually passes, the error comes from the difference between MRI's opal and compiled opal-parser
7
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
8
9
  fails "A block yielded a single Array assigns elements to required arguments when a keyword rest argument is present"
9
- fails "A block yielded a single Array assigns non-symbol keys to non-keyword arguments"
10
- fails "A block yielded a single Array assigns symbol keys from a Hash returned by #to_hash to keyword arguments"
11
- fails "A block yielded a single Array assigns symbol keys from a Hash to keyword arguments"
12
- fails "A block yielded a single Array assigns the last element to a non-keyword argument if #to_hash returns nil"
13
- fails "A block yielded a single Array calls #to_hash on the argument and uses resulting hash as first argument when optional argument and keyword argument accepted" # Expected [nil, {"a"=>1, "b"=>2}] == [{"a"=>1, "b"=>2}, {}] to be truthy but was false
14
- fails "A block yielded a single Array calls #to_hash on the argument but does not use the result when no keywords are present"
15
- fails "A block yielded a single Array calls #to_hash on the argument" # Expected [nil, {"a"=>1, "b"=>2}] to equal [{"a"=>1, "b"=>2}, {}]
16
10
  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
17
11
  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
18
12
  fails "A block yielded a single Array does not call #to_hash on the last element if keyword arguments are present" # ArgumentError: expected kwargs
19
13
  fails "A block yielded a single Array does not call #to_hash on the last element when there are more arguments than parameters" # ArgumentError: expected kwargs
20
14
  fails "A block yielded a single Array does not treat final Hash as keyword arguments and does not autosplat" # Expected [nil, {"a"=>10}] == [[{"a"=>10}], {}] to be truthy but was false
21
15
  fails "A block yielded a single Array does not treat hashes with string keys as keyword arguments and does not autosplat" # Expected [nil, {"a"=>10}] == [[{"a"=>10}], {}] to be truthy but was false
22
- fails "A block yielded a single Array does not treat hashes with string keys as keyword arguments"
23
- fails "A block yielded a single Array raises a TypeError if #to_hash does not return a Hash"
24
16
  fails "A block yielded a single Array when non-symbol keys are in a keyword arguments Hash does not separate non-symbol keys and symbol keys and does not autosplat" # Expected [nil, {"a"=>10, "b"=>2}] == [[{"a"=>10, "b"=>2}], {}] to be truthy but was false
25
- fails "A block yielded a single Array when non-symbol keys are in a keyword arguments Hash separates non-symbol keys and symbol keys" # Expected [nil, {"a"=>10, "b"=>2}] to equal [{"a"=>10}, {"b"=>2}]
26
- fails "A class definition extending an object (sclass) allows accessing the block of the original scope" # Opal::SyntaxError: undefined method `uses_block!' for nil
27
17
  fails "A class definition extending an object (sclass) can use return to cause the enclosing method to return"
28
18
  fails "A class definition extending an object (sclass) raises a TypeError when trying to extend numbers"
29
19
  fails "A class definition raises TypeError if any constant qualifying the class is not a Module"
@@ -32,20 +22,10 @@ opal_filter "language" do
32
22
  fails "A lambda expression 'lambda { ... }' assigns variables from parameters for definition '@a = lambda { |*, **k| k }'" # ArgumentError: expected kwargs
33
23
  fails "A lambda expression 'lambda { ... }' assigns variables from parameters for definition \n def m(a) yield a end\n def m2() yield end\n @a = lambda { |a, | a }"
34
24
  fails "A lambda expression 'lambda { ... }' requires a block"
35
- fails "A lambda expression 'lambda { ... }' with an implicit block can be created"
36
25
  fails "A lambda expression 'lambda { ... }' with an implicit block raises ArgumentError" # Expected ArgumentError (/tried to create Proc object without a block/) but no exception was raised (nil was returned)
37
26
  fails "A lambda literal -> () { } assigns variables from parameters for definition '@a = -> (*, **k) { k }'" # ArgumentError: expected kwargs
38
- fails "A lambda literal -> () { } assigns variables from parameters with circular optional argument reference shadows an existing local with the same name as the argument"
39
- fails "A lambda literal -> () { } assigns variables from parameters with circular optional argument reference shadows an existing method with the same name as the argument"
40
- fails "A lambda literal -> () { } assigns variables from parameters with circular optional argument reference warns and uses a nil value when there is an existing local variable with same name" # Expected warning to match: /circular argument reference/ but got: ""
41
- fails "A lambda literal -> () { } assigns variables from parameters with circular optional argument reference warns and uses a nil value when there is an existing method with same name" # Expected warning to match: /circular argument reference/ but got: ""
42
27
  fails "A method assigns local variables from method parameters for definition 'def m() end'" # ArgumentError: [SpecEvaluate#m] wrong number of arguments(1 for 0)
43
28
  fails "A method assigns local variables from method parameters for definition 'def m(*a) a end'" # Expected [{}] to equal []
44
- fails "A method assigns local variables from method parameters for definition 'def m(*a, **) a end'"
45
- fails "A method assigns local variables from method parameters for definition 'def m(*a, **k) [a, k] end'"
46
- fails "A method assigns local variables from method parameters for definition 'def m(*a, b: 1) [a, b] end'"
47
- fails "A method assigns local variables from method parameters for definition 'def m(*a, b:) [a, b] end'"
48
- fails "A method assigns local variables from method parameters for definition 'def m(a = nil, **k) [a, k] end'"
49
29
  fails "A method assigns local variables from method parameters for definition 'def m(a, **) a end'" # Expected ArgumentError but no exception was raised ({"a"=>1, "b"=>2} was returned)
50
30
  fails "A method assigns local variables from method parameters for definition 'def m(a, **k) [a, k] end'" # Expected ArgumentError but no exception was raised ([{"a"=>1, "b"=>2}, {}] was returned)
51
31
  fails "A method assigns local variables from method parameters for definition 'def m(a, **nil); a end;'" # Opal::SyntaxError: Unsupported arg type kwnilarg
@@ -70,10 +50,11 @@ opal_filter "language" do
70
50
  fails "A number literal can be a decimal literal with trailing 'r' to represent a Rational" # requires String#to_r
71
51
  fails "A number literal can be a float literal with trailing 'r' to represent a Rational" # Expected (5030569068109113/288230376151711740) == (136353847812057/7812500000000000) to be truthy but was false
72
52
  fails "A singleton class doesn't have singleton class"
73
- fails "A singleton class raises a TypeError for Fixnum's"
74
53
  fails "A singleton class raises a TypeError for symbols"
75
54
  fails "A singleton method definition can be declared for a global variable"
76
55
  fails "A singleton method definition raises FrozenError with the correct class name" # Expected FrozenError but no exception was raised ("foo" was returned)
56
+ fails "Accessing a class variable raises a RuntimeError when a class variable is overtaken in an ancestor class" # Expected RuntimeError (/class variable @@cvar_overtaken of .+ is overtaken by .+/) but no exception was raised ("subclass" was returned)
57
+ fails "Accessing a class variable raises a RuntimeError when accessed from the toplevel scope (not in some module or class)" # Expected RuntimeError (class variable access from toplevel) but got: NameError (uninitialized class variable @@cvar_toplevel1 in MSpecEnv)
77
58
  fails "Allowed characters allows non-ASCII lowercased characters at the beginning" # Expected nil == 1 to be truthy but was false
78
59
  fails "Allowed characters allows not ASCII upcased characters at the beginning" # NameError: wrong constant name ἍBB
79
60
  fails "Allowed characters does not allow non-ASCII upcased characters at the beginning" # Expected SyntaxError (/dynamic constant assignment/) but no exception was raised ("test" was returned)
@@ -86,8 +67,6 @@ opal_filter "language" do
86
67
  fails "An instance method raises an error with too many arguments" # ArgumentError: [MSpecEnv#foo] wrong number of arguments(2 for 1)
87
68
  fails "An instance method with a default argument evaluates the default when required arguments precede it" # ArgumentError: [MSpecEnv#foo] wrong number of arguments(0 for -2)
88
69
  fails "An instance method with a default argument prefers to assign to a default argument before a splat argument" # ArgumentError: [MSpecEnv#foo] wrong number of arguments(0 for -2)
89
- fails "An instance method with a default argument shadows an existing method with the same name as the local"
90
- fails "An instance method with a default argument warns and uses a nil value when there is an existing local method with same name" # Expected warning to match: /circular argument reference/ but got: ""
91
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
92
71
  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)
93
72
  fails "Executing break from within a block returns from the original invoking method even in case of chained calls"
@@ -109,24 +88,23 @@ opal_filter "language" do
109
88
  fails "Global variable $FILENAME is read-only"
110
89
  fails "Global variable $VERBOSE converts truthy values to true" # Expected 1 to be true
111
90
  fails "Global variable $\" is read-only"
91
+ fails "Hash literal checks duplicated float keys on initialization" # Expected warning to match: /key 1.0 is duplicated|duplicated key/ but got: ""
112
92
  fails "Hash literal checks duplicated keys on initialization" # Expected warning to match: /key 1000 is duplicated|duplicated key/ but got: ""
113
93
  fails "Hash literal expands a BasicObject using ** into the containing Hash literal initialization" # NoMethodError: undefined method `respond_to?' for BasicObject
114
- fails "Hash#deconstruct_keys requires one argument" # Expected ArgumentError (/wrong number of arguments \(given 0, expected 1\)/) but got: ArgumentError ([Hash#deconstruct_keys] wrong number of arguments(0 for 1))
115
94
  fails "Heredoc string allow HEREDOC with <<\"identifier\", interpolated" # Expected #<Encoding:UTF-16LE> to equal #<Encoding:ASCII-8BIT (dummy)>
116
95
  fails "Heredoc string allows HEREDOC with <<'identifier', no interpolation" # Expected #<Encoding:UTF-16LE> to equal #<Encoding:ASCII-8BIT (dummy)>
117
96
  fails "Heredoc string allows HEREDOC with <<-'identifier', allowing to indent identifier, no interpolation" # Expected #<Encoding:UTF-16LE> to equal #<Encoding:ASCII-8BIT (dummy)>
118
97
  fails "Heredoc string allows HEREDOC with <<-\"identifier\", allowing to indent identifier, interpolated" # Expected #<Encoding:UTF-16LE> to equal #<Encoding:ASCII-8BIT (dummy)>
119
98
  fails "Heredoc string allows HEREDOC with <<-identifier, allowing to indent identifier, interpolated" # Expected #<Encoding:UTF-16LE> to equal #<Encoding:ASCII-8BIT (dummy)>
120
99
  fails "Heredoc string allows HEREDOC with <<identifier, interpolated" # Expected #<Encoding:UTF-16LE> to equal #<Encoding:ASCII-8BIT (dummy)>
121
- fails "Heredoc string prints a warning if quoted HEREDOC identifier is ending not on same line" # Opal::SyntaxError: unterminated string meets end of file
122
100
  fails "Instantiating a singleton class raises a TypeError when allocate is called"
123
101
  fails "Instantiating a singleton class raises a TypeError when new is called"
124
- fails "Invoking a method expands the Array elements from the splat after executing the arguments and block if no other arguments follow the splat" # Expected [[1, nil], nil] to equal [[1], nil]
102
+ fails "Keyword arguments are now separated from positional arguments when the method takes a ** parameter does not convert a positional Hash to keyword arguments" # Expected ArgumentError (wrong number of arguments (given 4, expected 3)) but no exception was raised (42 was returned)
103
+ fails "Keyword arguments are now separated from positional arguments when the method takes a key: parameter when it's called with a positional Hash and no ** raises ArgumentError" # Expected ArgumentError (wrong number of arguments (given 4, expected 3)) but no exception was raised (42 was returned)
125
104
  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:0x50c0>::DOES_NOT_EXIST)
126
105
  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:0x50ba>::DOES_NOT_EXIST)
127
106
  fails "Literal (A::X) constant resolution with dynamically assigned constants evaluates the right hand side before evaluating a constant path"
128
107
  fails "Literal Regexps caches the Regexp object"
129
- fails "Literal Regexps raises a RegexpError for lookbehind with specific characters" # Expected RegexpError but no exception was raised (0 was returned)
130
108
  fails "Literal Regexps support handling unicode 9.0 characters with POSIX bracket expressions" # Expected "" to equal "𐓘"
131
109
  fails "Literal Regexps supports (?# )"
132
110
  fails "Literal Regexps supports (?> ) (embedded subexpression)"
@@ -139,8 +117,6 @@ opal_filter "language" do
139
117
  fails "Literal Regexps throws SyntaxError for malformed literals"
140
118
  fails "Literal Regexps treats an escaped non-escapable character normally when used as a terminator" # Expected "\\$" to equal "(?-mix:\\$)"
141
119
  fails "Local variable shadowing does not warn in verbose mode" # Expected nil == [3, 3, 3] to be truthy but was false
142
- fails "Local variable shadowing leads to warning in verbose mode" # Expected warning to match: /shadowing outer local variable/ but got: ""
143
- fails "Magic comment is optional"
144
120
  fails "Magic comments in a loaded file are case-insensitive" # LoadError: cannot load such file -- ruby/language/fixtures/case_magic_comment
145
121
  fails "Magic comments in a loaded file are optional" # LoadError: cannot load such file -- ruby/language/fixtures/no_magic_comment
146
122
  fails "Magic comments in a loaded file can be after the shebang" # LoadError: cannot load such file -- ruby/language/fixtures/shebang_magic_comment
@@ -196,7 +172,6 @@ opal_filter "language" do
196
172
  fails "Magic comments in the main file must be at the first line" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x8aa2e>
197
173
  fails "Magic comments in the main file must be the first token of the line" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x8aa2e>
198
174
  fails "NoMethodError#message calls receiver.inspect only when calling Exception#message" # Expected ["inspect_called"] to equal []
199
- fails "NoMethodError#message fallbacks to a simpler representation of the receiver when receiver.inspect raises an exception" # NoMethodError: undefined method `name' for #<NoMethodErrorSpecs::InstanceException: NoMethodErrorSpecs::InstanceException>
200
175
  fails "Numbered parameters does not support more than 9 parameters" # Expected NameError (/undefined local variable or method `_10'/) but got: NoMethodError (undefined method `_10' for #<MSpecEnv:0x5d700>)
201
176
  fails "Operators * / % are left-associative"
202
177
  fails "Operators <=> == === != =~ !~ have higher precedence than &&" # Expected false == false to be falsy but was true
@@ -204,7 +179,6 @@ opal_filter "language" do
204
179
  fails "Optional constant assignment with ||= causes side-effects of the module part to be applied only once (for undefined constant)" # Expected 2 == 1 to be truthy but was false
205
180
  fails "Optional variable assignments using compounded constants with &&= assignments" # Expected warning to match: /already initialized constant/ but got: ""
206
181
  fails "Optional variable assignments using compounded constants with operator assignments" # Expected warning to match: /already initialized constant/ but got: ""
207
- fails "Optional variable assignments using compunded constants with ||= assignments"
208
182
  fails "Pattern matching Array pattern calls #deconstruct once for multiple patterns, caching the result" # Expected ["deconstruct", "deconstruct"] == ["deconstruct"] to be truthy but was false
209
183
  fails "Pattern matching Array pattern raises TypeError if #deconstruct method does not return array" # Expected TypeError (/deconstruct must return Array/) but no exception was raised (nil was returned)
210
184
  fails "Pattern matching Hash pattern does not match object if #deconstruct_keys method does not return Hash" # Expected TypeError (/deconstruct_keys must return Hash/) but got: NoMethodError (undefined method `key?' for "")
@@ -216,17 +190,12 @@ opal_filter "language" do
216
190
  fails "Pattern matching variable pattern does not support using variable name (except _) several times" # Expected SyntaxError (/duplicated variable name/) but got: SyntaxError (duplicate variable name a)
217
191
  fails "Pattern matching variable pattern requires bound variable to be specified in a pattern before ^ operator when it relies on a bound variable" # Expected SyntaxError (/n: no such local variable/) but got: SyntaxError (no such local variable: `n')
218
192
  fails "Pattern matching variable pattern supports existing variables in a pattern specified with ^ operator" # SyntaxError: no such local variable: `a'
219
- fails "Pattern matching warning warns about pattern matching is experimental feature" # NameError: uninitialized constant Warning
220
- fails "Post-args with optional args with a circular argument reference shadows an existing local with the same name as the argument"
221
- fails "Post-args with optional args with a circular argument reference shadows an existing method with the same name as the argument"
222
- fails "Post-args with optional args with a circular argument reference warns and uses a nil value when there is an existing local variable with same name" # Expected warning to match: /circular argument reference/ but got: ""
223
- fails "Post-args with optional args with a circular argument reference warns and uses a nil value when there is an existing method with same name" # Expected warning to match: /circular argument reference/ but got: ""
193
+ fails "Pattern matching warning when regular form does not warn about pattern matching is experimental feature" # NameError: uninitialized constant Warning
224
194
  fails "Predefined global $+ captures the last non nil capture"
225
195
  fails "Predefined global $+ is equivalent to $~.captures.last"
226
196
  fails "Predefined global $, raises TypeError if assigned a non-String"
227
197
  fails "Predefined global $-0 changes $/"
228
198
  fails "Predefined global $-0 does not call #to_str to convert the object to a String"
229
- fails "Predefined global $-0 raises a TypeError if assigned a Fixnum"
230
199
  fails "Predefined global $-0 raises a TypeError if assigned a boolean"
231
200
  fails "Predefined global $-0 raises a TypeError if assigned an Integer" # Expected TypeError but no exception was raised (1 was returned)
232
201
  fails "Predefined global $. can be assigned a Float" # Expected 123.5 to equal 123
@@ -234,7 +203,6 @@ opal_filter "language" do
234
203
  fails "Predefined global $. should call #to_int to convert the object to an Integer" # Expected #<MockObject:0x518c2> to equal 321
235
204
  fails "Predefined global $/ changes $-0"
236
205
  fails "Predefined global $/ does not call #to_str to convert the object to a String"
237
- fails "Predefined global $/ raises a TypeError if assigned a Fixnum"
238
206
  fails "Predefined global $/ raises a TypeError if assigned a boolean"
239
207
  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)
240
208
  fails "Predefined global $_ is Thread-local"
@@ -246,12 +214,10 @@ opal_filter "language" do
246
214
  fails "Ruby String interpolation returns a string with the source encoding by default" # Expected #<Encoding:UTF-8> == #<Encoding:ASCII-8BIT (dummy)> to be truthy but was false
247
215
  fails "Ruby String interpolation returns a string with the source encoding, even if the components have another encoding" # ArgumentError: unknown encoding name - euc-jp
248
216
  fails "Safe navigator allows assignment methods"
249
- fails "Struct#deconstruct_keys requires one argument" # Expected ArgumentError (/wrong number of arguments \(given 0, expected 1\)/) but got: ArgumentError ([#deconstruct_keys] wrong number of arguments(0 for 1))
250
- fails "The =~ operator with named captures on syntax of 'string_literal' =~ /regexp/ does not set local variables" # Exception: named captures are not supported in javascript: "(?<matched>foo)(?<unmatched>bar)?"
251
- fails "The =~ operator with named captures on syntax of /regexp/ =~ string_variable sets local variables by the captured pairs"
252
- fails "The =~ operator with named captures on syntax of regexp_variable =~ string_variable does not set local variables"
253
- fails "The =~ operator with named captures on syntax of string_variable =~ /regexp/ does not set local variables"
254
- fails "The =~ operator with named captures on the method calling does not set local variables"
217
+ fails "The ** operator hash with omitted value accepts mixed syntax" # NameError: uninitialized constant MSpecEnv::a
218
+ fails "The ** operator hash with omitted value accepts short notation 'key' for 'key: value' syntax" # NameError: uninitialized constant MSpecEnv::a
219
+ fails "The ** operator hash with omitted value ignores hanging comma on short notation" # NameError: uninitialized constant MSpecEnv::a
220
+ fails "The ** operator hash with omitted value works with methods and local vars" # NameError: uninitialized constant #<Class:0x874c0>::bar
255
221
  fails "The BEGIN keyword accesses variables outside the eval scope"
256
222
  fails "The BEGIN keyword runs first in a given code unit"
257
223
  fails "The BEGIN keyword runs in a shared scope"
@@ -269,7 +235,6 @@ opal_filter "language" do
269
235
  fails "The __LINE__ pseudo-variable equals the line number of the text in a loaded file"
270
236
  fails "The alias keyword can create a new global variable, synonym of the original" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x4478>
271
237
  fails "The alias keyword can override an existing global variable and make them synonyms" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x4478>
272
- fails "The alias keyword is not allowed against Fixnum or String instances"
273
238
  fails "The alias keyword is not allowed against Integer or String instances" # Expected TypeError but got: Exception (Cannot read property '$to_s' of undefined)
274
239
  fails "The alias keyword on top level defines the alias on Object"
275
240
  fails "The alias keyword operates on methods defined via attr, attr_reader, and attr_accessor"
@@ -296,10 +261,24 @@ opal_filter "language" do
296
261
  fails "The class keyword does not raise a SyntaxError when opening a class without a semicolon" # NameError: uninitialized constant ClassSpecsKeywordWithoutSemicolon
297
262
  fails "The def keyword within a closure looks outside the closure for the visibility"
298
263
  fails "The defined? keyword for a scoped constant returns nil when a constant is defined on top-level but not on the class" # Expected "constant" to be nil
264
+ fails "The defined? keyword for a simple constant returns 'constant' when the constant is defined" # Expected false == true to be truthy but was false
265
+ fails "The defined? keyword for an expression returns 'assignment' for assigning a local variable" # Expected false == true to be truthy but was false
266
+ fails "The defined? keyword for literals for a literal Array returns 'expression' if each element is defined" # Expected false == true to be truthy but was false
267
+ fails "The defined? keyword for literals returns 'false' for false" # Expected false == true to be truthy but was false
268
+ fails "The defined? keyword for literals returns 'nil' for nil" # Expected false == true to be truthy but was false
269
+ fails "The defined? keyword for literals returns 'self' for self" # Expected false == true to be truthy but was false
270
+ fails "The defined? keyword for literals returns 'true' for true" # Expected false == true to be truthy but was false
271
+ fails "The defined? keyword for super for a method taking no arguments returns 'super' when a superclass method exists" # Expected false == true to be truthy but was false
272
+ fails "The defined? keyword for variables returns 'class variable' when called with the name of a class variable" # Expected false == true to be truthy but was false
273
+ fails "The defined? keyword for variables returns 'global-variable' for a global variable that has been assigned nil" # Expected false == true to be truthy but was false
299
274
  fails "The defined? keyword for variables returns 'instance-variable' for an instance variable that has been assigned to nil"
275
+ fails "The defined? keyword for variables returns 'instance-variable' for an instance variable that has been assigned" # Expected false == true to be truthy but was false
276
+ fails "The defined? keyword for variables returns 'local-variable' when called with the name of a local variable" # Expected false == true to be truthy but was false
300
277
  fails "The defined? keyword for variables returns nil for a global variable that has been read but not assigned to"
301
278
  fails "The defined? keyword for variables when a Regexp matches a String returns nil for non-captures"
302
279
  fails "The defined? keyword for variables when a String matches a Regexp returns nil for non-captures"
280
+ 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
281
+ 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
303
282
  fails "The if expression with a boolean range ('flip-flop' operator) evaluates the first conditions lazily with exclusive-end range"
304
283
  fails "The if expression with a boolean range ('flip-flop' operator) evaluates the first conditions lazily with inclusive-end range"
305
284
  fails "The or operator has a lower precedence than 'next' in 'next true or false'"
@@ -312,9 +291,7 @@ opal_filter "language" do
312
291
  fails "The rescue keyword only accepts Module or Class in rescue clauses" # RuntimeError: error
313
292
  fails "The rescue keyword only accepts Module or Class in splatted rescue clauses" # RuntimeError: error
314
293
  fails "The rescue keyword rescues the exception in the deepest rescue block declared to handle the appropriate exception type" # Expected "StandardError: an error occurred" to include ":in `raise_standard_error'"
315
- fails "The rescue keyword will execute an else block even without rescue and ensure" # Expected warning to match: /else without rescue is useless/ but got: ""
316
294
  fails "The return keyword at top level return with argument warns but does not affect exit status" # Exception: path.substr is not a function
317
- fails "The return keyword at top level within a block within a class is allowed" # Exception: path.substr is not a function
318
295
  fails "The return keyword at top level within a block within a class is not allowed" # Exception: path.substr is not a function
319
296
  fails "The super keyword uses block argument given to method when used in a block" # LocalJumpError: no block given
320
297
  fails "The super keyword uses given block even if arguments are passed explicitly"
@@ -327,8 +304,11 @@ opal_filter "language" do
327
304
  fails "The while expression stops running body if interrupted by break in a parenthesized element op-assign value"
328
305
  fails "The yield call taking a single argument yielding to a lambda should not destructure an Array into multiple arguments" # Expected ArgumentError but no exception was raised ([1, 2] was returned)
329
306
  fails "The yield call taking no arguments ignores assignment to the explicit block argument and calls the passed block"
307
+ fails "Using yield in a singleton class literal raises a SyntaxError" # Expected SyntaxError (/Invalid yield/) but got: SyntaxError (undefined method `uses_block!' for nil)
330
308
  fails "a method definition that sets more than one default parameter all to the same value only allows overriding the default value of the first such parameter in each set" # ArgumentError: [MSpecEnv#foo] wrong number of arguments(2 for -1)
331
309
  fails "a method definition that sets more than one default parameter all to the same value treats the argument after the multi-parameter normally" # ArgumentError: [MSpecEnv#bar] wrong number of arguments(3 for -1)
310
+ fails "kwarg with omitted value in a method call accepts short notation 'kwarg' in method call for definition 'def call(*args, **kwargs) = [args, kwargs]'" # NameError: uninitialized constant SpecEvaluate::a
311
+ fails "kwarg with omitted value in a method call with methods and local variables for definition \n def call(*args, **kwargs) = [args, kwargs]\n def bar\n \"baz\"\n end\n def foo(val)\n call bar:, val:\n end" # NameError: uninitialized constant SpecEvaluate::bar
332
312
  fails "self in a metaclass body (class << obj) raises a TypeError for numbers"
333
313
  fails "self in a metaclass body (class << obj) raises a TypeError for symbols"
334
314
  fails "self.send(:block_given?) returns false when a method defined by define_method is called with a block"
@@ -2,12 +2,10 @@
2
2
  opal_filter "main" do
3
3
  fails "main#include in a file loaded with wrapping includes the given Module in the load wrapper" # ArgumentError: [MSpecEnv#load] wrong number of arguments(2 for 1)
4
4
  fails "main#private raises a NameError when at least one of given method names is undefined" # Expected NameError but no exception was raised (nil was returned)
5
- fails "main#private returns Object" # Expected nil to be identical to Object
6
5
  fails "main#private when multiple arguments are passed sets the visibility of the given methods to private" # Expected Object to have private method 'main_public_method' but it does not
7
6
  fails "main#private when single argument is passed and is an array sets the visibility of the given methods to private" # Expected Object to have private method 'main_public_method' but it does not
8
7
  fails "main#private when single argument is passed and it is not an array sets the visibility of the given methods to private" # Expected Object to have private method 'main_public_method' but it does not
9
8
  fails "main#public raises a NameError when given an undefined name" # Expected NameError but no exception was raised (nil was returned)
10
- fails "main#public returns Object" # Expected nil to be identical to Object
11
9
  fails "main.ruby2_keywords is the same as Object.ruby2_keywords" # Expected main to have private method 'ruby2_keywords' but it does not
12
10
  fails "main.using does not propagate refinements of new modules added after it is called" # Expected "quux" == "bar" to be truthy but was false
13
11
  fails "main.using requires one Module argument" # Expected TypeError but no exception was raised (main was returned)
@@ -3,7 +3,6 @@ opal_filter "Marshal" do
3
3
  fails "Marshal.dump ignores the recursion limit if the limit is negative" # no support yet
4
4
  fails "Marshal.dump raises a TypeError if dumping a Mutex instance" # Expected TypeError but no exception was raised ("\u0004\bo:\nMutex\u0006:\f@lockedF" was returned)
5
5
  fails "Marshal.dump when passed a StringIO should raise an error" # Expected TypeError but no exception was raised ("\u0004\bo:\rStringIO\a:\f@string\"\u0000:\u000E@positioni\u0000" was returned)
6
- fails "Marshal.dump with a Range dumps a Range with extra instance variables" # Expected nil to equal 42
7
6
  fails "Marshal.dump with a Regexp dumps a Regexp subclass" # requires Class.new(Regexp).new("").class != Regexp
8
7
  fails "Marshal.dump with a Regexp dumps a Regexp with instance variables" # //.source.should == ''
9
8
  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
@@ -30,8 +29,6 @@ opal_filter "Marshal" do
30
29
  fails "Marshal.load for a Symbol loads an encoded Symbol" # Expected "â\u0086\u0092" to equal "→"
31
30
  fails "Marshal.load for a Time loads nanoseconds"
32
31
  fails "Marshal.load for a Time loads"
33
- fails "Marshal.load for a user Class raises ArgumentError if the object from an 'o' stream is not dumpable as 'o' type user class"
34
- fails "Marshal.load for a user Class that extends a core type other than Object or BasicObject raises ArgumentError if the resulting class does not extend the same type"
35
32
  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" # TypeError: no implicit conversion of Hash into Integer
36
33
  fails "Marshal.load for an Exception loads a marshalled exception with a backtrace"
37
34
  fails "Marshal.load for an Exception loads a marshalled exception with a message"
@@ -44,8 +41,10 @@ opal_filter "Marshal" do
44
41
  fails "Marshal.load loads an array containing objects having _dump method, and with proc"
45
42
  fails "Marshal.load loads an array containing objects having marshal_dump method, and with proc"
46
43
  fails "Marshal.load when a class does not exist in the namespace raises an ArgumentError" # an issue with constant resolving, e.g. String::Array
44
+ fails "Marshal.load when called with a proc call the proc with fully initialized strings" # ArgumentError: [Marshal.load] wrong number of arguments(2 for 1)
47
45
  fails "Marshal.load when called with a proc calls the proc for recursively visited data"
48
46
  fails "Marshal.load when called with a proc loads an Array with proc"
47
+ 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(2 for 1)
49
48
  fails "Marshal.load when called with a proc returns the value of the proc"
50
49
  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(2 for 1)
51
50
  end
@@ -1,39 +1,3 @@
1
1
  # NOTE: run bin/format-filters after changing this file
2
2
  opal_filter "Matrix" do
3
- fails "Matrix#** returns the power for non integer powers" # RangeError: can't convert 7.000000000000007+8.881784197001252e-16i into Float
4
- fails "Matrix#/ returns the result of dividing self by a Bignum" # Expected Matrix[[1.0842021724855044e-19, 2.168404344971009e-19], [3.2526065174565133e-19, 4.336808689942018e-19]] == Matrix[[0, 0], [0, 0]] to be truthy but was false
5
- fails "Matrix#/ returns the result of dividing self by a Fixnum" # Expected Matrix[[0.5, 1], [1.5, 2]] == Matrix[[0, 1], [1, 2]] to be truthy but was false
6
- fails "Matrix#antisymmetric? returns false for non-antisymmetric matrices" # Expected true to be false
7
- fails "Matrix#each returns an Enumerator when called without a block" # ArgumentError: tried to create a Proc object without a block
8
- fails "Matrix#each returns self" # ArgumentError: tried to create a Proc object without a block
9
- fails "Matrix#each yields the elements starting with the those of the first row" # ArgumentError: tried to create a Proc object without a block
10
- fails "Matrix#each_with_index with an argument raises an ArgumentError for unrecognized argument" # Expected ArgumentError but no exception was raised (Matrix[[1, 2, 3, 4], [5, 6, 7, 8]] was returned)
11
- fails "Matrix#eql? returns false if some elements are == but not eql?" # Expected true to be false
12
- fails "Matrix#find_index with a subselection argument and a generic argument returns the index of the requested value" # ArgumentError: [Matrix#[]] wrong number of arguments(0 for 2)
13
- fails "Matrix#find_index with a subselection argument and no generic argument returns the first index for which the block returns true" # ArgumentError: [Matrix#[]] wrong number of arguments(0 for 2)
14
- fails "Matrix#find_index with only a generic argument ignores a block" # Expected nil == [0, 3] to be truthy but was false
15
- fails "Matrix#find_index with only a generic argument returns the first index for of the requested value" # Expected nil == [0, 2] to be truthy but was false
16
- fails "Matrix#find_index with two arguments raises an ArgumentError for an unrecognized last argument" # Expected ArgumentError but no exception was raised (nil was returned)
17
- fails "Matrix#find_index without any argument returns the first index for which the block is true" # Expected nil == [0, 2] to be truthy but was false
18
- fails "Matrix#hash returns an Integer" # Expected "A,A,3,5" (String) to be an instance of Integer
19
- fails "Matrix#real? returns false if one element is a Complex whose imaginary part is 0" # ArgumentError: tried to create a Proc object without a block
20
- fails "Matrix#real? returns false if one element is a Complex" # ArgumentError: tried to create a Proc object without a block
21
- fails "Matrix#real? returns true for empty matrices" # ArgumentError: tried to create a Proc object without a block
22
- fails "Matrix#real? returns true for matrices with all real entries" # ArgumentError: tried to create a Proc object without a block
23
- fails "Matrix.diagonal? returns false for a non diagonal square Matrix" # Expected true to be false
24
- fails "Matrix.hermitian? returns false for a matrix with complex values on the diagonal" # Expected true to be false
25
- fails "Matrix.hermitian? returns false for an asymmetric Matrix" # Expected true to be false
26
- fails "Matrix.lower_triangular? returns false for a non lower triangular square Matrix" # Expected true to be false
27
- fails "Matrix.symmetric? returns false for an asymmetric Matrix" # Expected true to be false
28
- fails "Matrix.upper_triangular? returns false for a non upper triangular square Matrix" # Expected true to be false
29
- fails "Matrix.zero? returns false for matrices with non zero entries" # ArgumentError: tried to create a Proc object without a block
30
- fails "Matrix.zero? returns true for empty matrices" # ArgumentError: tried to create a Proc object without a block
31
- fails "Matrix.zero? returns true for matrices with zero entries" # ArgumentError: tried to create a Proc object without a block
32
- fails "Matrix::EigenvalueDecomposition#eigenvalue_matrix returns a diagonal matrix with the eigenvalues on the diagonal" # Expected Matrix[[-7.661903789690598, 0], [0, 15.661903789690601]] == Matrix[[6, 0], [0, 2]] to be truthy but was false
33
- fails "Matrix::EigenvalueDecomposition#eigenvalues returns an array of complex eigenvalues for a rotation matrix" # Expected [0, 1.9999999999999998] == [(1-1i), (1+1i)] to be truthy but was false
34
- fails "Matrix::EigenvalueDecomposition#eigenvalues returns an array of real eigenvalues for a matrix" # Expected [-7.6619037897, 15.6619037897] == [2, 6] to be truthy but was false
35
- fails "Matrix::EigenvalueDecomposition#eigenvector_matrix returns a complex eigenvector matrix given a rotation matrix" # Expected Matrix[[-0.7071067811865475, -0.7071067811865475], [-0.7071067811865475, 0.7071067811865475]] == Matrix[[1, 1], [(0+1i), (0-1i)]] to be truthy but was false
36
- fails "Matrix::EigenvalueDecomposition#eigenvectors returns an array of complex eigenvectors for a rotation matrix" # Expected [Vector[-0.7071067811865475, -0.7071067811865475], Vector[-0.7071067811865475, 0.7071067811865475]] == [Vector[1, (0+1i)], Vector[1, (0-1i)]] to be truthy but was false
37
- fails "Matrix::EigenvalueDecomposition#to_a returns a factorization" # Expected Matrix[[14, -6], [-6, -6]] == Matrix[[14, 16], [-6, -6]] to be truthy but was false
38
- fails "Vector#eql? returns false when there are a pair corresponding elements which are not equal in the sense of Kernel#eql?" # Expected true to be false
39
3
  end
@@ -1,19 +1,17 @@
1
1
  # NOTE: run bin/format-filters after changing this file
2
2
  opal_filter "Module" do
3
3
  fails "Module#alias_method creates methods that are == to each other" # Expected #<Method: #<Class:0x9122>#uno (defined in #<Class:0x9122> in ruby/core/module/fixtures/classes.rb:206)> == #<Method: #<Class:0x9122>#public_one (defined in ModuleSpecs::Aliasing in ruby/core/module/fixtures/classes.rb:206)> to be truthy but was false
4
- fails "Module#alias_method creates methods that are == to eachother" # Expected #<Method: #<Class:0x3ee54>#uno (defined in #<Class:0x3ee54> in ruby/core/module/fixtures/classes.rb:203)> to equal #<Method: #<Class:0x3ee54>#public_one (defined in ModuleSpecs::Aliasing in ruby/core/module/fixtures/classes.rb:203)>
5
4
  fails "Module#alias_method handles aliasing a method only present in a refinement" # NoMethodError: undefined method `refine' for #<Module:0x90fa>
6
5
  fails "Module#alias_method retains method visibility"
7
6
  fails "Module#alias_method returned value returns symbol of the defined method name" # Expected #<Class:0x1c94a> to be identical to "checking_return_value"
7
+ fails "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
8
8
  fails "Module#append_features on Class raises a TypeError if calling after rebinded to Class"
9
9
  fails "Module#attr applies current visibility to methods created"
10
10
  fails "Module#attr converts non string/symbol names to strings using to_str" # Expected false == true to be truthy but was false
11
- fails "Module#attr converts non string/symbol/fixnum names to strings using to_str"
12
11
  fails "Module#attr raises a TypeError when the given names can't be converted to strings using to_str"
13
12
  fails "Module#attr returns an array of defined method names as symbols" # Expected nil == ["foo", "bar"] to be truthy but was false
14
13
  fails "Module#attr_accessor applies current visibility to methods created"
15
14
  fails "Module#attr_accessor converts non string/symbol names to strings using to_str" # Expected false == true to be truthy but was false
16
- fails "Module#attr_accessor converts non string/symbol/fixnum names to strings using to_str"
17
15
  fails "Module#attr_accessor not allows creating an attr_accessor on an immediate class"
18
16
  fails "Module#attr_accessor on immediates can read through the accessor" # NoMethodError: undefined method `foobar' for 1
19
17
  fails "Module#attr_accessor raises FrozenError if the receiver if frozen" # Expected FrozenError but no exception was raised (42 was returned)
@@ -21,56 +19,15 @@ opal_filter "Module" do
21
19
  fails "Module#attr_accessor returns an array of defined method names as symbols" # Expected nil == ["foo", "foo=", "bar", "bar="] to be truthy but was false
22
20
  fails "Module#attr_reader applies current visibility to methods created"
23
21
  fails "Module#attr_reader converts non string/symbol names to strings using to_str" # Expected false == true to be truthy but was false
24
- fails "Module#attr_reader converts non string/symbol/fixnum names to strings using to_str"
25
22
  fails "Module#attr_reader not allows for adding an attr_reader to an immediate"
26
23
  fails "Module#attr_reader raises a TypeError when the given names can't be converted to strings using to_str"
27
24
  fails "Module#attr_reader returns an array of defined method names as symbols" # Expected nil == ["foo", "bar"] to be truthy but was false
28
25
  fails "Module#attr_writer applies current visibility to methods created"
29
26
  fails "Module#attr_writer converts non string/symbol names to strings using to_str" # Expected false == true to be truthy but was false
30
- fails "Module#attr_writer converts non string/symbol/fixnum names to strings using to_str"
31
27
  fails "Module#attr_writer not allows for adding an attr_writer to an immediate"
32
28
  fails "Module#attr_writer raises FrozenError if the receiver if frozen" # Expected FrozenError but no exception was raised (42 was returned)
33
29
  fails "Module#attr_writer raises a TypeError when the given names can't be converted to strings using to_str"
34
30
  fails "Module#attr_writer returns an array of defined method names as symbols" # Expected nil == ["foo=", "bar="] to be truthy but was false
35
- fails "Module#autoload (concurrently) blocks a second thread while a first is doing the autoload"
36
- fails "Module#autoload (concurrently) blocks others threads while doing an autoload"
37
- fails "Module#autoload allows multiple autoload constants for a single file"
38
- fails "Module#autoload calls #to_path on non-String filename arguments"
39
- fails "Module#autoload calls #to_path on non-string filenames"
40
- fails "Module#autoload does NOT raise a NameError when the autoload file did not define the constant and a module is opened with the same name"
41
- fails "Module#autoload does not load the file if the file is manually required"
42
- fails "Module#autoload does not load the file when accessing the constants table of the module"
43
- fails "Module#autoload does not load the file when referring to the constant in defined?"
44
- fails "Module#autoload does not remove the constant from the constant table if load fails"
45
- fails "Module#autoload does not remove the constant from the constant table if the loaded files does not define it"
46
- fails "Module#autoload ignores the autoload request if the file is already loaded"
47
- fails "Module#autoload loads a file with .rb extension when passed the name without the extension"
48
- fails "Module#autoload loads the file that defines subclass XX::YY < YY and YY is a top level constant"
49
- fails "Module#autoload loads the file when opening a module that is the autoloaded constant"
50
- fails "Module#autoload loads the registered constant into a dynamically created class"
51
- fails "Module#autoload loads the registered constant into a dynamically created module"
52
- fails "Module#autoload loads the registered constant when it is accessed"
53
- fails "Module#autoload loads the registered constant when it is included"
54
- fails "Module#autoload loads the registered constant when it is inherited from"
55
- fails "Module#autoload loads the registered constant when it is opened as a class"
56
- fails "Module#autoload loads the registered constant when it is opened as a module"
57
- fails "Module#autoload looks up the constant in the scope where it is referred"
58
- fails "Module#autoload looks up the constant when in a meta class scope"
59
- fails "Module#autoload raises a NameError when the constant name has a space in it"
60
- fails "Module#autoload raises a NameError when the constant name starts with a lower case letter"
61
- fails "Module#autoload raises a NameError when the constant name starts with a number"
62
- fails "Module#autoload raises a TypeError if not passed a String or object respodning to #to_path for the filename"
63
- fails "Module#autoload raises a TypeError if opening a class with a different superclass than the class defined in the autoload file"
64
- fails "Module#autoload raises an ArgumentError when an empty filename is given"
65
- fails "Module#autoload registers a file to load the first time the named constant is accessed"
66
- fails "Module#autoload retains the autoload even if the request to require fails"
67
- fails "Module#autoload returns 'constant' on referring the constant with defined?()"
68
- fails "Module#autoload runs for an exception condition class and doesn't trample the exception"
69
- fails "Module#autoload sets the autoload constant in the constants table"
70
- fails "Module#autoload shares the autoload request across dup'ed copies of modules"
71
- fails "Module#autoload when changing $LOAD_PATH does not reload a file due to a different load path"
72
- fails "Module#autoload? returns nil if no file has been registered for a constant"
73
- fails "Module#autoload? returns the name of the file that will be autoloaded"
74
31
  fails "Module#class_eval activates refinements from the eval scope" # NoMethodError: undefined method `foo' for #<ModuleSpecs::NamedClass:0x4a168>
75
32
  fails "Module#class_eval converts a non-string filename to a string using to_str"
76
33
  fails "Module#class_eval converts non string eval-string to string using to_str"
@@ -87,7 +44,7 @@ opal_filter "Module" do
87
44
  fails "Module#const_defined? returns true when passed a scoped constant name"
88
45
  fails "Module#const_get coerces the inherit flag to a boolean" # Expected NameError but no exception was raised ("const1" was returned)
89
46
  fails "Module#const_set sets the name of a module scoped by an anonymous module" # NoMethodError: undefined method `end_with?' for nil
90
- fails "Module#const_set when overwriting an existing constant does not warn if the previous value was undefined" # Expected #<Module:0x48fd0> to have constant 'Foo' but it does not
47
+ fails "Module#const_set when overwriting an existing constant does not warn after a failed autoload" # Expected NameError but got: LoadError (cannot load such file -- ruby/core/module/fixtures/autoload_o)
91
48
  fails "Module#const_set when overwriting an existing constant warns if the previous value was a normal value" # Expected warning to match: /already initialized constant/ but got: ""
92
49
  fails "Module#const_source_location accepts a String or Symbol name" # NoMethodError: undefined method `__dir__' for #<MSpecEnv:0x6efae>
93
50
  fails "Module#const_source_location accepts a scoped constant name" # NoMethodError: undefined method `__dir__' for #<MSpecEnv:0x6efae>
@@ -98,13 +55,7 @@ opal_filter "Module" do
98
55
  fails "Module#const_source_location does not search the containing scope" # NoMethodError: undefined method `__dir__' for #<MSpecEnv:0x6efae>
99
56
  fails "Module#const_source_location does not search the singleton class of a Class or Module" # NoMethodError: undefined method `__dir__' for #<MSpecEnv:0x6efae>
100
57
  fails "Module#const_source_location does search private constants path" # NoMethodError: undefined method `__dir__' for #<MSpecEnv:0x6efae>
101
- fails "Module#const_source_location raises a NameError if a Symbol has a toplevel scope qualifier" # NoMethodError: undefined method `__dir__' for #<MSpecEnv:0x6efae>
102
- fails "Module#const_source_location raises a NameError if a Symbol is a scoped constant name" # NoMethodError: undefined method `__dir__' for #<MSpecEnv:0x6efae>
103
- fails "Module#const_source_location raises a NameError if only '::' is passed" # NoMethodError: undefined method `__dir__' for #<MSpecEnv:0x6efae>
104
58
  fails "Module#const_source_location raises a NameError if the name contains non-alphabetic characters except '_'" # NoMethodError: undefined method `__dir__' for #<MSpecEnv:0x6efae>
105
- fails "Module#const_source_location raises a NameError if the name does not start with a capital letter" # NoMethodError: undefined method `__dir__' for #<MSpecEnv:0x6efae>
106
- fails "Module#const_source_location raises a NameError if the name includes two successive scope separators" # NoMethodError: undefined method `__dir__' for #<MSpecEnv:0x6efae>
107
- fails "Module#const_source_location raises a NameError if the name starts with a non-alphabetic character" # NoMethodError: undefined method `__dir__' for #<MSpecEnv:0x6efae>
108
59
  fails "Module#const_source_location raises a TypeError if conversion to a String by calling #to_str fails" # NoMethodError: undefined method `__dir__' for #<MSpecEnv:0x6efae>
109
60
  fails "Module#const_source_location return empty path if constant defined in C code" # NoMethodError: undefined method `__dir__' for #<MSpecEnv:0x6efae>
110
61
  fails "Module#const_source_location returns nil if no constant is defined in the search path" # NoMethodError: undefined method `__dir__' for #<MSpecEnv:0x6efae>
@@ -138,6 +89,7 @@ opal_filter "Module" do
138
89
  fails "Module#deprecate_constant accepts multiple symbols and strings as constant names"
139
90
  fails "Module#deprecate_constant raises a NameError when given an undefined name"
140
91
  fails "Module#deprecate_constant returns self"
92
+ fails "Module#deprecate_constant when accessing the deprecated module does not warn if Warning[:deprecated] is false" # NoMethodError: undefined method `deprecate_constant' for #<Module:0x133e6>
141
93
  fails "Module#deprecate_constant when accessing the deprecated module passes the accessing"
142
94
  fails "Module#deprecate_constant when accessing the deprecated module warns with a message"
143
95
  fails "Module#extend_object extends the given object with its constants and methods by default"
@@ -151,7 +103,6 @@ opal_filter "Module" do
151
103
  fails "Module#method_added is called with a precise caller location with the line of the 'def'" # NoMethodError: undefined method `caller_locations' for #<Module:0xaa8>
152
104
  fails "Module#method_defined? converts the given name to a string using to_str"
153
105
  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)
154
- fails "Module#method_defined? raises a TypeError when the given object is not a string/symbol/fixnum"
155
106
  fails "Module#method_defined? returns true if a public or private method with the given name is defined in self, self's ancestors or one of self's included modules"
156
107
  fails "Module#method_defined? when passed false as a second optional argument checks only the class itself" # ArgumentError: [Child.method_defined?] wrong number of arguments(2 for 1)
157
108
  fails "Module#method_defined? when passed true as a second optional argument performs a lookup in ancestors" # ArgumentError: [Child.method_defined?] wrong number of arguments(2 for 1)
@@ -173,11 +124,11 @@ opal_filter "Module" do
173
124
  fails "Module#name is not nil for a nested module created with the module keyword"
174
125
  fails "Module#name is not nil when assigned to a constant in an anonymous module" # NoMethodError: undefined method `end_with?' for nil
175
126
  fails "Module#name is set after it is removed from a constant under an anonymous module" # Expected nil to match /^#<Module:0x\h+>::Child$/
176
- fails "Module#prepend keeps the module in the chain when dupping an intermediate module"
177
127
  fails "Module#prepend keeps the module in the chain when dupping the class"
178
128
  fails "Module#prepend uses only new module when dupping the module" # Expected [#<Module:0x6c37a>] == [#<Module:0x6c38c>, #<Module:0x6c37a>] to be truthy but was false
179
129
  fails "Module#private with argument array as a single argument sets visibility of given method names" # Expected #<Module:0x7b0e0> to have private instance method 'test1' but it does not
180
130
  fails "Module#private with argument one or more arguments sets visibility of given method names" # Expected #<Module:0x2f186> to have private instance method 'test1' but it does not
131
+ 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)
181
132
  fails "Module#private_constant marked constants in a module raises a NameError when accessed directly from modules that include the module" # Expected NameError but no exception was raised (true was returned)
182
133
  fails "Module#private_constant marked constants sends #const_missing to the original class or module" # Expected true == "Foo" to be truthy but was false
183
134
  fails "Module#private_method_defined? raises a TypeError if passed an Integer" # Expected TypeError but no exception was raised (false was returned)
@@ -196,15 +147,11 @@ opal_filter "Module" do
196
147
  fails "Module#refine applies refinements to calls in the refine block" # NoMethodError: undefined method `foo' for "hello"
197
148
  fails "Module#refine does not override methods in subclasses" # Expected "foo from refinement" == "foo from subclass" to be truthy but was false
198
149
  fails "Module#refine for methods accessed indirectly is honored by BasicObject#__send__" # Expected "foo" == "foo from refinement" to be truthy but was false
199
- fails "Module#refine for methods accessed indirectly is honored by Kernel#instance_method" # NameError: undefined method `foo' for class `'
200
- fails "Module#refine for methods accessed indirectly is honored by Kernel#method" # NameError: undefined method `foo' for class `#<Class:0x6854>'
201
150
  fails "Module#refine for methods accessed indirectly is honored by Kernel#public_method" # NoMethodError: undefined method `public_method' for #<#<Class:0x1b194>:0x1b196>
202
151
  fails "Module#refine for methods accessed indirectly is honored by Kernel#public_send" # Expected "foo" == "foo from refinement" to be truthy but was false
203
- fails "Module#refine for methods accessed indirectly is honored by Kernel#respond_to?" # Expected false == true to be truthy but was false
204
152
  fails "Module#refine for methods accessed indirectly is honored by Kernel#send" # Expected "foo" == "foo from refinement" to be truthy but was false
205
153
  fails "Module#refine for methods accessed indirectly is honored by Symbol#to_proc"
206
154
  fails "Module#refine for methods accessed indirectly is honored by string interpolation"
207
- fails "Module#refine looks in the included modules for builtin methods"
208
155
  fails "Module#refine makes available all refinements from the same module" # NoMethodError: undefined method `dump' for "1"
209
156
  fails "Module#refine method lookup looks in the included modules for builtin methods" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x1aaee>
210
157
  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
@@ -212,10 +159,6 @@ opal_filter "Module" do
212
159
  fails "Module#refine module inclusion overrides methods of ancestors by methods in descendants" # NoMethodError: undefined method `to_json_format' for 5
213
160
  fails "Module#refine raises ArgumentError if not given a block" # Expected ArgumentError but got: LocalJumpError (no block given)
214
161
  fails "Module#refine raises TypeError if not passed a class" # Expected TypeError but no exception was raised (#<Module:0x1abe8> was returned)
215
- fails "Module#refine when super is called in a refinement looks in the another active refinement if super called from included modules" # Expected ["B", "C"] == ["B", "A", "C"] to be truthy but was false
216
- fails "Module#refine when super is called in a refinement looks in the current active refinement from included modules" # Expected ["B", "C"] == ["B", "A", "LAST", "C"] to be truthy but was false
217
- fails "Module#refine when super is called in a refinement looks in the included to refinery module" # Expected "foo" == "foo from included module" to be truthy but was false
218
- fails "Module#refine when super is called in a refinement looks in the lexical scope refinements before other active refinements" # Expected ["A", "C"] == ["A", "LOCAL", "C"] to be truthy but was false
219
162
  fails "Module#remove_const calls #to_str to convert the given name to a String"
220
163
  fails "Module#remove_const raises a TypeError if conversion to a String by calling #to_str fails"
221
164
  fails "Module#ruby2_keywords acceps String as well" # NoMethodError: undefined method `ruby2_keywords' for #<Class:#<Object:0x40040>>
@@ -244,4 +187,7 @@ opal_filter "Module" do
244
187
  fails "Module#using scope of refinement is active for class defined via Class.new {}" # NoMethodError: undefined method `foo' for 1
245
188
  fails "Module#using scope of refinement is active for module defined via Module.new {}" # NoMethodError: undefined method `foo' for 1
246
189
  fails "Module#using works in classes too" # NoMethodError: undefined method `foo' for 1
190
+ fails_badly "Module#refine for methods accessed indirectly is honored by Kernel#instance_method" # NameError: undefined method `foo' for class `'
191
+ fails_badly "Module#refine for methods accessed indirectly is honored by Kernel#method" # NameError: undefined method `foo' for class `#<Class:0x581e4>'
192
+ fails_badly "Module#refine for methods accessed indirectly is honored by Kernel#respond_to?" # Expected false == true to be truthy but was false
247
193
  end
@@ -9,11 +9,4 @@ opal_filter "Numeric" do
9
9
  fails "Numeric#remainder returns the result of calling self#% with other if self and other are less than 0"
10
10
  fails "Numeric#remainder returns the result of calling self#% with other if self is 0"
11
11
  fails "Numeric#singleton_method_added raises a TypeError when trying to define a singleton method on a Numeric"
12
- fails "Numeric#step with keyword arguments when no block is given returns an Enumerator::ArithmeticSequence when not passed a block and self < stop" # Expected #<Enumerator: 1:step(2, 3)> (Enumerator) to be an instance of Enumerator::ArithmeticSequence
13
- fails "Numeric#step with keyword arguments when no block is given returns an Enumerator::ArithmeticSequence when not passed a block and self > stop" # Expected #<Enumerator: 1:step(0, 2)> (Enumerator) to be an instance of Enumerator::ArithmeticSequence
14
- fails "Numeric#step with mixed arguments when no block is given returns an Enumerator::ArithmeticSequence when not passed a block and self < stop" # Expected #<Enumerator: 1:step(2, 3)> (Enumerator) to be an instance of Enumerator::ArithmeticSequence
15
- fails "Numeric#step with mixed arguments when no block is given returns an Enumerator::ArithmeticSequence when not passed a block and self > stop" # Expected #<Enumerator: 1:step(0, 2)> (Enumerator) to be an instance of Enumerator::ArithmeticSequence
16
- fails "Numeric#step with positional args when no block is given returned Enumerator::ArithmeticSequence type returns an instance of Enumerator::ArithmeticSequence" # Expected Enumerator == Enumerator::ArithmeticSequence to be truthy but was false
17
- fails "Numeric#step with positional args when no block is given returns an Enumerator::ArithmeticSequence when not passed a block and self < stop" # Expected #<Enumerator: 1:step(2, 3)> (Enumerator) to be an instance of Enumerator::ArithmeticSequence
18
- fails "Numeric#step with positional args when no block is given returns an Enumerator::ArithmeticSequence when not passed a block and self > stop" # Expected #<Enumerator: 1:step(0, 2)> (Enumerator) to be an instance of Enumerator::ArithmeticSequence
19
12
  end
@@ -43,9 +43,9 @@ opal_filter "ObjectSpace" do
43
43
  fails "ObjectSpace.each_object on singleton classes walks singleton classes" # NoMethodError: undefined method `each_object' for ObjectSpace
44
44
  fails "ObjectSpace.each_object returns an enumerator if not given a block" # NoMethodError: undefined method `each_object' for ObjectSpace
45
45
  fails "ObjectSpace.each_object walks a class and its normal descendants when passed the class's singleton class" # NoMethodError: undefined method `each_object' for ObjectSpace
46
+ fails "ObjectSpace.garbage_collect accepts keyword arguments" # NoMethodError: undefined method `garbage_collect' for ObjectSpace
46
47
  fails "ObjectSpace.garbage_collect always returns nil" # NoMethodError: undefined method `garbage_collect' for ObjectSpace
47
48
  fails "ObjectSpace.garbage_collect can be invoked without any exceptions" # Expected to not get Exception but got: NoMethodError (undefined method `garbage_collect' for ObjectSpace)
48
- fails "ObjectSpace.garbage_collect doesn't accept any arguments" # Expected ArgumentError but got: NoMethodError (undefined method `garbage_collect' for ObjectSpace)
49
49
  fails "ObjectSpace.garbage_collect ignores the supplied block" # Expected to not get Exception but got: NoMethodError (undefined method `garbage_collect' for ObjectSpace)
50
50
  fails "ObjectSpace::WeakMap#[] matches using identity semantics" # Expected "x" == nil to be truthy but was false
51
51
  fails "ObjectSpace::WeakMap#each is correct" # NotImplementedError: #each can't be implemented on top of JS interfaces
@@ -50,9 +50,7 @@ opal_filter "Array#pack" do
50
50
  fails "Array#pack with format 'A' calls #to_str to coerce the directives string" # RuntimeError: Unsupported pack directive "x" (no chunk reader defined)
51
51
  fails "Array#pack with format 'A' returns a string in encoding of common to the concatenated results" # RuntimeError: Unsupported pack directive "U" (no chunk reader defined)
52
52
  fails "Array#pack with format 'C' calls #to_str to coerce the directives string" # RuntimeError: Unsupported pack directive "x" (no chunk reader defined)
53
- fails "Array#pack with format 'C' returns an ASCII-8BIT string" # Expected #<Encoding:UTF-16LE> to equal #<Encoding:ASCII-8BIT>
54
53
  fails "Array#pack with format 'L' calls #to_str to coerce the directives string" # RuntimeError: Unsupported pack directive "x" (no chunk reader defined)
55
- fails "Array#pack with format 'L' returns an ASCII-8BIT string" # Expected #<Encoding:UTF-16LE> to equal #<Encoding:ASCII-8BIT>
56
54
  fails "Array#pack with format 'L' with modifier '>' and '!' calls #to_int to convert the pack argument to an Integer" # Mock 'to_int' expected to receive to_int("any_args") exactly 1 times but received it 0 times
57
55
  fails "Array#pack with format 'L' with modifier '>' and '!' encodes a Float truncated as an Integer" # RuntimeError: Unsupported pack directive "L>" (no chunk reader defined)
58
56
  fails "Array#pack with format 'L' with modifier '>' and '!' encodes all remaining elements when passed the '*' modifier" # RuntimeError: Unsupported pack directive "L>" (no chunk reader defined)
@@ -83,9 +81,7 @@ opal_filter "Array#pack" do
83
81
  fails "Array#pack with format 'a' calls #to_str to coerce the directives string" # RuntimeError: Unsupported pack directive "x" (no chunk reader defined)
84
82
  fails "Array#pack with format 'a' returns a string in encoding of common to the concatenated results" # RuntimeError: Unsupported pack directive "U" (no chunk reader defined)
85
83
  fails "Array#pack with format 'c' calls #to_str to coerce the directives string" # RuntimeError: Unsupported pack directive "x" (no chunk reader defined)
86
- fails "Array#pack with format 'c' returns an ASCII-8BIT string" # Expected #<Encoding:UTF-16LE> to equal #<Encoding:ASCII-8BIT>
87
84
  fails "Array#pack with format 'l' calls #to_str to coerce the directives string" # RuntimeError: Unsupported pack directive "x" (no chunk reader defined)
88
- fails "Array#pack with format 'l' returns an ASCII-8BIT string" # Expected #<Encoding:UTF-16LE> to equal #<Encoding:ASCII-8BIT>
89
85
  fails "Array#pack with format 'l' with modifier '>' and '!' calls #to_int to convert the pack argument to an Integer" # Mock 'to_int' expected to receive to_int("any_args") exactly 1 times but received it 0 times
90
86
  fails "Array#pack with format 'l' with modifier '>' and '!' encodes a Float truncated as an Integer" # RuntimeError: Unsupported pack directive "l>" (no chunk reader defined)
91
87
  fails "Array#pack with format 'l' with modifier '>' and '!' encodes all remaining elements when passed the '*' modifier" # RuntimeError: Unsupported pack directive "l>" (no chunk reader defined)