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,6 +1,5 @@
1
1
  # NOTE: run bin/format-filters after changing this file
2
2
  opal_filter "Proc" do
3
- fails "Proc as an implicit block pass argument remains the same object if re-vivified by the target method"
4
3
  fails "Proc#<< composition is a lambda when parameter is lambda" # NoMethodError: undefined method `<<' for #<Proc:0x760e0>
5
4
  fails "Proc#<< does not try to coerce argument with #to_proc" # Expected TypeError (callable object is expected) but got: NoMethodError (undefined method `<<' for #<Proc:0x760c8>)
6
5
  fails "Proc#<< raises TypeError if passed not callable object" # Expected TypeError (callable object is expected) but got: NoMethodError (undefined method `<<' for #<Proc:0x760d8>)
@@ -31,13 +30,11 @@ opal_filter "Proc" do
31
30
  fails "Proc#inspect for a proc created with Proc.new has a binary encoding" # Expected #<Encoding:UTF-16LE> to equal #<Encoding:ASCII-8BIT (dummy)>
32
31
  fails "Proc#inspect for a proc created with Proc.new returns a description including file and line number" # Expected "#<Proc:0x200>" =~ /^#<Proc:([^ ]*?)@ruby\/core\/proc\/shared\/to_s\.rb:6>$/ to be truthy but was nil
33
32
  fails "Proc#inspect for a proc created with Symbol#to_proc has a binary encoding" # Expected #<Encoding:UTF-16LE> to equal #<Encoding:ASCII-8BIT (dummy)>
34
- fails "Proc#inspect for a proc created with Symbol#to_proc has an ASCII-8BIT encoding" # Expected #<Encoding:UTF-16LE> to equal #<Encoding:ASCII-8BIT (dummy)>
35
33
  fails "Proc#inspect for a proc created with Symbol#to_proc returns a description including '(&:symbol)'" # Expected "#<Proc:0x75d4e>" to match /^#<Proc:0x\h+\(&:foobar\)>$/
36
34
  fails "Proc#inspect for a proc created with UnboundMethod#to_proc has a binary encoding" # Expected #<Encoding:UTF-16LE> to equal #<Encoding:ASCII-8BIT (dummy)>
37
35
  fails "Proc#inspect for a proc created with UnboundMethod#to_proc returns a description including '(lambda)' and optionally including file and line number"
38
36
  fails "Proc#inspect for a proc created with lambda has a binary encoding" # Expected #<Encoding:UTF-16LE> to equal #<Encoding:ASCII-8BIT (dummy)>
39
37
  fails "Proc#inspect for a proc created with lambda returns a description including '(lambda)' and including file and line number" # Expected "#<Proc:0x22e>" =~ /^#<Proc:([^ ]*?)@ruby\/core\/proc\/shared\/to_s\.rb:16 \(lambda\)>$/ to be truthy but was nil
40
- fails "Proc#inspect for a proc created with lambda returns a description including '(lambda)' and optionally including file and line number"
41
38
  fails "Proc#inspect for a proc created with proc has a binary encoding" # Expected #<Encoding:UTF-16LE> to equal #<Encoding:ASCII-8BIT (dummy)>
42
39
  fails "Proc#inspect for a proc created with proc returns a description including file and line number" # Expected "#<Proc:0x25a>" =~ /^#<Proc:([^ ]*?)@ruby\/core\/proc\/shared\/to_s\.rb:26>$/ to be truthy but was nil
43
40
  fails "Proc#lambda? is preserved when passing a Proc with & to the lambda keyword"
@@ -52,19 +49,16 @@ opal_filter "Proc" do
52
49
  fails "Proc#source_location returns the location of the proc's body; not necessarily the proc itself"
53
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] to equal nil
54
51
  fails "Proc#source_location sets the first value to the path of the file in which the proc was defined"
55
- fails "Proc#source_location sets the last value to a Fixnum representing the line on which the proc was defined"
56
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
57
53
  fails "Proc#source_location works even if the proc was created on the same line"
58
54
  fails "Proc#to_s for a proc created with Proc.new has a binary encoding" # Expected #<Encoding:UTF-16LE> to equal #<Encoding:ASCII-8BIT (dummy)>
59
55
  fails "Proc#to_s for a proc created with Proc.new returns a description including file and line number" # Expected "#<Proc:0x17cc0>" =~ /^#<Proc:([^ ]*?)@ruby\/core\/proc\/shared\/to_s\.rb:6>$/ to be truthy but was nil
60
56
  fails "Proc#to_s for a proc created with Symbol#to_proc has a binary encoding" # Expected #<Encoding:UTF-16LE> to equal #<Encoding:ASCII-8BIT (dummy)>
61
- fails "Proc#to_s for a proc created with Symbol#to_proc has an ASCII-8BIT encoding" # Expected #<Encoding:UTF-16LE> to equal #<Encoding:ASCII-8BIT (dummy)>
62
57
  fails "Proc#to_s for a proc created with Symbol#to_proc returns a description including '(&:symbol)'" # Expected "#<Proc:0x6cd2c>" to match /^#<Proc:0x\h+\(&:foobar\)>$/
63
58
  fails "Proc#to_s for a proc created with UnboundMethod#to_proc has a binary encoding" # Expected #<Encoding:UTF-16LE> to equal #<Encoding:ASCII-8BIT (dummy)>
64
59
  fails "Proc#to_s for a proc created with UnboundMethod#to_proc returns a description including '(lambda)' and optionally including file and line number"
65
60
  fails "Proc#to_s for a proc created with lambda has a binary encoding" # Expected #<Encoding:UTF-16LE> to equal #<Encoding:ASCII-8BIT (dummy)>
66
61
  fails "Proc#to_s for a proc created with lambda returns a description including '(lambda)' and including file and line number" # Expected "#<Proc:0x17cec>" =~ /^#<Proc:([^ ]*?)@ruby\/core\/proc\/shared\/to_s\.rb:16 \(lambda\)>$/ to be truthy but was nil
67
- fails "Proc#to_s for a proc created with lambda returns a description including '(lambda)' and optionally including file and line number"
68
62
  fails "Proc#to_s for a proc created with proc has a binary encoding" # Expected #<Encoding:UTF-16LE> to equal #<Encoding:ASCII-8BIT (dummy)>
69
63
  fails "Proc#to_s for a proc created with proc returns a description including file and line number" # Expected "#<Proc:0x17d18>" =~ /^#<Proc:([^ ]*?)@ruby\/core\/proc\/shared\/to_s\.rb:26>$/ to be truthy but was nil
70
64
  fails "Proc#yield can call its block argument declared with a block argument" # Expected 6 to equal 10
@@ -79,9 +73,6 @@ opal_filter "Proc" do
79
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"
80
74
  fails "Proc.new with an associated block calls initialize on the Proc object"
81
75
  fails "Proc.new with an associated block raises a LocalJumpError when context of the block no longer exists"
82
- fails "Proc.new with an associated block returns a new Proc instance from the block passed to the containing method"
83
76
  fails "Proc.new with an associated block returns a subclass of Proc"
84
77
  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)
85
- fails "Proc.new without a block uses the implicit block from an enclosing method when called inside a block" # ArgumentError: tried to create a Proc object without a block
86
- fails "Proc.new without a block uses the implicit block from an enclosing method"
87
78
  end
@@ -3,11 +3,6 @@ opal_filter "Random" do
3
3
  fails "Random#bytes returns the same numeric output for a given huge seed across all implementations and platforms" # Expected "z­" to equal "_\u0091"
4
4
  fails "Random#bytes returns the same numeric output for a given seed across all implementations and platforms" # Expected "ÚG" to equal "\u0014\\"
5
5
  fails "Random#rand with Range supports custom object types" # Expected "NaN#<struct RandomSpecs::CustomRangeInteger value=1>" (String) to be an instance of RandomSpecs::CustomRangeInteger
6
- fails "Random.raw_seed raises an ArgumentError on a negative size" # NoMethodError: undefined method `raw_seed' for Random
7
- fails "Random.raw_seed returns a String of the length given as argument" # NoMethodError: undefined method `raw_seed' for Random
8
- fails "Random.raw_seed returns a String" # NoMethodError: undefined method `raw_seed' for Random
9
- fails "Random.raw_seed returns a random binary String" # NoMethodError: undefined method `raw_seed' for Random
10
- fails "Random.raw_seed returns an ASCII-8BIT String" # NoMethodError: undefined method `raw_seed' for Random
11
6
  fails "Random::DEFAULT changes seed on reboot" # NoMethodError: undefined method `insert' for "rubyexe.rb"
12
7
  fails "Random::DEFAULT is deprecated" # Expected #<Random:0x3e>.equal? Random to be truthy but was false
13
8
  fails "Random::DEFAULT refers to the Random class" # Expected #<Random:0x3e>.equal? Random to be truthy but was false
@@ -1,7 +1,5 @@
1
1
  # NOTE: run bin/format-filters after changing this file
2
2
  opal_filter "Range" do
3
- fails "Range#% produces an arithmetic sequence with a percent sign in #inspect" # NoMethodError: undefined method `%' for 1..10
4
- fails "Range#% works as a Range#step" # NoMethodError: undefined method `%' for 1..10
5
3
  fails "Range#bsearch with Float values with a block returning negative, zero, positive numbers accepts (+/-)Float::INFINITY from the block" # TypeError: can't iterate from Float
6
4
  fails "Range#bsearch with Float values with a block returning negative, zero, positive numbers returns a boundary element if appropriate" # NoMethodError: undefined method `prev_float' for 3
7
5
  fails "Range#bsearch with Float values with a block returning negative, zero, positive numbers returns an element at an index for which block returns 0 (small numbers)" # TypeError: can't iterate from Float
@@ -59,7 +57,6 @@ opal_filter "Range" do
59
57
  fails "Range#cover? range argument accepts range argument" # Expected false to be true
60
58
  fails "Range#cover? range argument honors exclusion of right boundary (:exclude_end option)" # Expected false to be true
61
59
  fails "Range#cover? range argument supports boundaries of different comparable types" # Expected false to be true
62
- fails "Range#each raises a TypeError if the first element is a Time object" # Expected TypeError but no exception was raised (2021-01-02 22:49:45 +0100..2021-01-02 22:49:46 +0100 was returned)
63
60
  fails "Range#eql? returns false if the endpoints are not eql?" # Expected 0..1 not to have same value or type as 0..1
64
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)
65
62
  fails "Range#hash generates an Integer for the hash value" # Expected "A,1,1,0" (String) to be an instance of Integer
@@ -89,11 +86,9 @@ opal_filter "Range" do
89
86
  fails "Range#minmax on an inclusive range should return the minimum and maximum values for a non-numeric range without iterating the range" # Mock 'x' expected to receive succ("any_args") exactly 0 times but received it 1 times
90
87
  fails "Range#minmax on an inclusive range should return the minimum and maximum values for a numeric range without iterating the range" # TypeError: can't iterate from Float
91
88
  fails "Range#size returns nil for endless ranges if the start is not numeric" # Expected Infinity == nil to be truthy but was false
92
- fails "Range#step when no block is given raises an ArgumentError if step is 0" # Expected ArgumentError but no exception was raised (#<Enumerator: -1..1:step(0)> was returned)
93
89
  fails "Range#step when no block is given returned Enumerator size raises a TypeError if #to_int does not return an Integer" # Expected TypeError but no exception was raised (#<Enumerator: 1..2:step(#<MockObject:0x2d238>)> was returned)
94
90
  fails "Range#step when no block is given returned Enumerator size raises a TypeError if step does not respond to #to_int" # Expected TypeError but no exception was raised (#<Enumerator: 1..2:step(#<MockObject:0x2d214>)> was returned)
95
- fails "Range#step when no block is given returned Enumerator size returns the ceil of range size divided by the number of steps even if step is negative" # ArgumentError: step can't be negative
96
- fails "Range#step when no block is given returned Enumerator type when both begin and end are numerics returns an instance of Enumerator::ArithmeticSequence" # Expected Enumerator == Enumerator::ArithmeticSequence to be truthy but was false
91
+ fails "Range#step when no block is given returned Enumerator size returns the range size when there's no step_size" # Expected 9 == 10 to be truthy but was false
97
92
  fails "Range#step with an endless range and Float values yields Float values incremented by a Float step" # Expected [-1, 0] to have same value and type as [-1, -0.5, 0, 0.5]
98
93
  fails "Range#step with an endless range and Integer values yields Float values incremented by a Float step" # Expected [-2, 1] to have same value and type as [-2, -0.5, 1]
99
94
  fails "Range#step with exclusive end and String values raises a TypeError when passed a Float step" # Expected TypeError but no exception was raised ("A"..."G" was returned)
@@ -9,7 +9,6 @@ opal_filter "regular_expressions" do
9
9
  fails "Regexp#encoding defaults to UTF-8 if a literal UTF-8 character appears"
10
10
  fails "Regexp#encoding ignores the default_internal encoding"
11
11
  fails "Regexp#encoding ignores the encoding and uses US-ASCII if the string has only ASCII characters"
12
- fails "Regexp#encoding returns ASCII-8BIT if the 'n' modifier is supplied and non-US-ASCII characters are present"
13
12
  fails "Regexp#encoding returns BINARY if the 'n' modifier is supplied and non-US-ASCII characters are present" # NoMethodError: undefined method `encoding' for /\xc2\xa1/
14
13
  fails "Regexp#encoding returns EUC_JP if the 'e' modifier is supplied"
15
14
  fails "Regexp#encoding returns US_ASCII if the 'n' modifier is supplied and only US-ASCII characters are present"
@@ -27,7 +26,6 @@ opal_filter "regular_expressions" do
27
26
  fails "Regexp#fixed_encoding? returns true if the Regexp was created with the Regexp::FIXEDENCODING option"
28
27
  fails "Regexp#hash is based on the text and options of Regexp"
29
28
  fails "Regexp#hash returns the same value for two Regexps differing only in the /n option"
30
- fails "Regexp#initialize raises a SecurityError on a Regexp literal"
31
29
  fails "Regexp#initialize raises a TypeError on an initialized non-literal Regexp"
32
30
  fails "Regexp#inspect does not include a character set code"
33
31
  fails "Regexp#inspect does not include the 'o' option"
@@ -41,7 +39,6 @@ opal_filter "regular_expressions" do
41
39
  fails "Regexp#to_s shows non-included options after a - sign"
42
40
  fails "Regexp#to_s shows the pattern after the options"
43
41
  fails "Regexp.compile given a Regexp does not honour options given as additional arguments" # Expected warning to match: /flags ignored/ but got: ""
44
- fails "Regexp.compile given a String accepts a Fixnum of two or more options ORed together as the second argument" # Expected 0 not to equal 0
45
42
  fails "Regexp.compile given a String accepts an Integer of two or more options ORed together as the second argument" # Expected 0 == 0 to be falsy but was true
46
43
  fails "Regexp.compile given a String ignores the third argument if it is 'e' or 'euc' (case-insensitive)" # ArgumentError: [Regexp.new] wrong number of arguments(3 for -2)
47
44
  fails "Regexp.compile given a String ignores the third argument if it is 's' or 'sjis' (case-insensitive)" # ArgumentError: [Regexp.new] wrong number of arguments(3 for -2)
@@ -2,6 +2,8 @@
2
2
  opal_filter "Set" do
3
3
  fails "Set#& raises an ArgumentError when passed a non-Enumerable"
4
4
  fails "Set#& returns a new Set containing only elements shared by self and the passed Enumerable"
5
+ fails "Set#<=> returns +1 if the set is a proper superset of other set" # Expected nil == 1 to be truthy but was false
6
+ fails "Set#<=> returns -1 if the set is a proper subset of the other set" # Expected nil == -1 to be truthy but was false
5
7
  fails "Set#== does not depend on the order of nested Sets"
6
8
  fails "Set#== returns true when the passed Object is a Set and self and the Object contain the same elements"
7
9
  fails "Set#=== is an alias for include?" # Expected #<Method: Set#=== (defined in Kernel in corelib/kernel.rb:14)> to equal #<Method: Set#include? (defined in Set in set.rb:125)>
@@ -42,11 +44,16 @@ opal_filter "Set" do
42
44
  fails "Set#hash is static"
43
45
  fails "Set#initialize uses #each on the provided Enumerable if it does not respond to #each_entry" # ArgumentError: value must be enumerable
44
46
  fails "Set#initialize uses #each_entry on the provided Enumerable" # ArgumentError: value must be enumerable
47
+ fails "Set#initialize_clone does not freeze the new Set when called from clone(freeze: false)" # Expected false == true to be truthy but was false
45
48
  fails "Set#inspect correctly handles self-references"
46
49
  fails "Set#intersection raises an ArgumentError when passed a non-Enumerable"
47
50
  fails "Set#intersection returns a new Set containing only elements shared by self and the passed Enumerable"
51
+ fails "Set#join calls #to_a to convert the Set in to an Array" # NoMethodError: undefined method `join' for #<Set: {a,b,c}>
52
+ fails "Set#join does not separate elements when the passed separator is nil" # NoMethodError: undefined method `join' for #<Set: {a,b,c}>
53
+ fails "Set#join returns a new string formed by joining elements after conversion" # NoMethodError: undefined method `join' for #<Set: {a,b,c}>
54
+ fails "Set#join returns a string formed by concatenating each element separated by the separator" # NoMethodError: undefined method `join' for #<Set: {a,b,c}>
55
+ fails "Set#join returns an empty string if the Set is empty" # NoMethodError: undefined method `join' for #<Set: {}>
48
56
  fails "Set#merge raises an ArgumentError when passed a non-Enumerable"
49
- fails "Set#pretty_print passes the 'pretty print' representation of self to the pretty print writer"
50
57
  fails "Set#pretty_print_cycle passes the 'pretty print' representation of a self-referencing Set to the pretty print writer"
51
58
  fails "Set#to_s correctly handles self-references" # Expected "#<Set:0x865de>" to include "#<Set: {...}>"
52
59
  fails "Set#to_s is an alias of inspect" # Expected #<Method: Set#to_s (defined in Kernel in corelib/kernel.rb:1201)> to equal #<Method: Set#inspect (defined in Set in set.rb:36)>
@@ -53,9 +53,6 @@ opal_filter "String" do
53
53
  fails "String#+ when self and the argument are in different ASCII-compatible encodings uses the argument's encoding if self is ASCII-only" # Expected #<Encoding:UTF-8> == #<Encoding:ISO-8859-1> to be truthy but was false
54
54
  fails "String#+ when self is in an ASCII-incompatible encoding incompatible with the argument's encoding raises Encoding::CompatibilityError if neither are empty" # Expected Encoding::CompatibilityError but no exception was raised ("xy" was returned)
55
55
  fails "String#+ when the argument is in an ASCII-incompatible encoding incompatible with self's encoding raises Encoding::CompatibilityError if neither are empty" # Expected Encoding::CompatibilityError but no exception was raised ("xy" was returned)
56
- fails "String#-@ does not deduplicate already frozen strings" # Expected "this string is frozen" not to be identical to "this string is frozen"
57
- fails "String#-@ does not deduplicate strings with additional instance variables" # NoMethodError: undefined method `-@' for "this string is frozen"
58
- fails "String#-@ does not deduplicate tainted strings" # NoMethodError: undefined method `-@' for "this string is frozen"
59
56
  fails "String#-@ returns the same object for equal unfrozen strings" # Expected "this is a string" not to be identical to "this is a string"
60
57
  fails "String#<< when self is BINARY and argument is US-ASCII uses BINARY encoding" # NotImplementedError: String#<< not supported. Mutable String methods are not supported in Opal.
61
58
  fails "String#<< with Integer returns a BINARY string if self is US-ASCII and the argument is between 128-255 (inclusive)" # NotImplementedError: String#<< not supported. Mutable String methods are not supported in Opal.
@@ -68,8 +65,6 @@ opal_filter "String" do
68
65
  fails "String#[] with Range raises a RangeError if one of the bound is too big" # Expected RangeError but no exception was raised (nil was returned)
69
66
  fails "String#[] with Range raises a type error if a range is passed with a length" # Expected TypeError but no exception was raised ("el" was returned)
70
67
  fails "String#[] with Range returns String instances" # Expected "" (StringSpecs::MyString) to be an instance of String
71
- fails "String#[] with Range works with beginless ranges" # TypeError: no implicit conversion of NilClass into Integer
72
- fails "String#[] with Range works with endless ranges" # Opal::SyntaxError: undefined method `type' for nil
73
68
  fails "String#[] with Regexp returns String instances" # Expected "" (StringSpecs::MyString) to be an instance of String
74
69
  fails "String#[] with Regexp, index returns String instances" # Expected "he" (StringSpecs::MyString) to be an instance of String
75
70
  fails "String#[] with String returns a String instance when given a subclass instance" # Expected "el" (StringSpecs::MyString) to be an instance of String
@@ -81,8 +76,6 @@ opal_filter "String" do
81
76
  fails "String#byteslice with Range raises a RangeError if one of the bound is too big" # Expected RangeError but no exception was raised (nil was returned)
82
77
  fails "String#byteslice with Range raises a type error if a range is passed with a length" # Expected TypeError but no exception was raised ("el" was returned)
83
78
  fails "String#byteslice with Range returns String instances" # Expected "" (StringSpecs::MyString) to be an instance of String
84
- fails "String#byteslice with Range works with beginless ranges" # TypeError: no implicit conversion of NilClass into Integer
85
- fails "String#byteslice with Range works with endless ranges" # Opal::SyntaxError: undefined method `type' for nil
86
79
  fails "String#byteslice with index, length raises a RangeError if the index or length is too big" # Expected RangeError but no exception was raised (nil was returned)
87
80
  fails "String#byteslice with index, length returns String instances" # Expected "" (StringSpecs::MyString) to be an instance of String
88
81
  fails "String#byteslice with index, length returns a string with the same encoding" # ArgumentError: unknown encoding name - ISO-8859-1
@@ -124,9 +117,7 @@ opal_filter "String" do
124
117
  fails "String#dump returns a string with # not escaped when followed by any other character" # NoMethodError: undefined method `dump' for "#"
125
118
  fails "String#dump returns a string with \" and \\ escaped with a backslash" # NoMethodError: undefined method `dump' for "\""
126
119
  fails "String#dump returns a string with \\#<char> when # is followed by $, @, @@, {" # NoMethodError: undefined method `dump' for "\#$PATH"
127
- fails "String#dump returns a string with \\#<char> when # is followed by $, @, {" # NoMethodError: undefined method `dump' for "\#$"
128
120
  fails "String#dump returns a string with lower-case alpha characters unescaped" # NoMethodError: undefined method `dump' for "a"
129
- fails "String#dump returns a string with multi-byte UTF-8 characters replaced by \\u{} notation with lower-case hex digits" # NoMethodError: undefined method `dump' for "\u0080"
130
121
  fails "String#dump returns a string with multi-byte UTF-8 characters replaced by \\u{} notation with upper-case hex digits" # NoMethodError: undefined method `dump' for "\u0080"
131
122
  fails "String#dump returns a string with non-printing ASCII characters replaced by \\x notation" # NoMethodError: undefined method `dump' for "\u0000"
132
123
  fails "String#dump returns a string with non-printing single-byte UTF-8 characters replaced by \\x notation" # NoMethodError: undefined method `dump' for "\u0000"
@@ -134,7 +125,6 @@ opal_filter "String" do
134
125
  fails "String#dump returns a string with printable non-alphanumeric characters unescaped" # NoMethodError: undefined method `dump' for " "
135
126
  fails "String#dump returns a string with special characters replaced with \\<char> notation" # NoMethodError: undefined method `dump' for "\a"
136
127
  fails "String#dump returns a string with upper-case alpha characters unescaped" # NoMethodError: undefined method `dump' for "A"
137
- fails "String#dump returns a subclass instance" # NoMethodError: undefined method `dump' for ""
138
128
  fails "String#dump wraps string with \"" # NoMethodError: undefined method `dump' for "foo"
139
129
  fails "String#dup calls #initialize_copy on the new instance" # Expected nil to equal "string"
140
130
  fails "String#each_byte keeps iterating from the old position (to new string end) when self changes" # NotImplementedError: String#<< not supported. Mutable String methods are not supported in Opal.
@@ -144,26 +134,18 @@ opal_filter "String" do
144
134
  fails "String#each_grapheme_cluster returns a different character if the String is transcoded" # NoMethodError: undefined method `each_grapheme_cluster' for "€"
145
135
  fails "String#each_grapheme_cluster returns characters in the same encoding as self" # ArgumentError: unknown encoding name - Shift_JIS
146
136
  fails "String#each_grapheme_cluster returns self" # NoMethodError: undefined method `each_grapheme_cluster' for "ab🏳️\u200D🌈🐾"
147
- fails "String#each_grapheme_cluster taints resulting strings when self is tainted" # NoMethodError: undefined method `each_grapheme_cluster' for "hello"
148
137
  fails "String#each_grapheme_cluster uses the String's encoding to determine what characters it contains" # NoMethodError: undefined method `each_grapheme_cluster' for "𤭢"
149
138
  fails "String#each_grapheme_cluster when no block is given returned enumerator size should return the size of the string" # NoMethodError: undefined method `each_grapheme_cluster' for "hello"
150
139
  fails "String#each_grapheme_cluster when no block is given returns an enumerator" # NoMethodError: undefined method `each_grapheme_cluster' for "hello"
151
140
  fails "String#each_grapheme_cluster works if the String's contents is invalid for its encoding" # Expected true to be false
152
141
  fails "String#each_grapheme_cluster works with multibyte characters" # NoMethodError: undefined method `each_grapheme_cluster' for "覇"
153
- fails "String#each_line when `chomp` keyword argument is passed ignores new line characters when separator is specified" # ArgumentError: [String#each_line] wrong number of arguments(2 for -1)
154
- fails "String#each_line when `chomp` keyword argument is passed removes new line characters when separator is not specified" # TypeError: no implicit conversion of Hash into String
155
- fails "String#each_line when `chomp` keyword argument is passed removes new line characters" # TypeError: no implicit conversion of Hash into String
156
- fails "String#each_line when `chomp` keyword argument is passed removes only specified separator" # ArgumentError: [String#each_line] wrong number of arguments(2 for -1)
157
- fails "String#each_line yields String instances for subclasses" # Expected [StringSpecs::MyString, StringSpecs::MyString] == [String, String] to be truthy but was false
158
- fails "String#each_line yields paragraphs (broken by 2 or more successive newlines) when passed '' and replaces multiple newlines with only two ones" # Expected ["hello\nworld\n\n\n", "and\nuniverse\n\n\n\n\n"] to equal ["hello\nworld\n\n", "and\nuniverse\n\n"]
159
- fails "String#encode when passed options replaces invalid encoding" # NoMethodError: undefined method `default_internal' for Encoding
142
+ fails "String#each_grapheme_cluster yields String instances for subclasses" # NoMethodError: undefined method `each_grapheme_cluster' for "abc"
160
143
  fails "String#encode when passed to, from, options returns a copy in the destination encoding when both encodings are the same" # NoMethodError: undefined method `default_internal' for Encoding
161
144
  fails "String#encoding for Strings with \\x escapes returns BINARY when an escape creates a byte with the 8th bit set if the source encoding is US-ASCII" # Expected #<Encoding:UTF-8> to equal #<Encoding:ASCII-8BIT (dummy)>
162
145
  fails "String#end_with? raises an Encoding::CompatibilityError if the encodings are incompatible" # NameError: uninitialized constant Encoding::EUC_JP
163
146
  fails "String#eql? considers encoding compatibility" # Expected true to be false
164
147
  fails "String#eql? considers encoding difference of incompatible string" # Expected true to be false
165
148
  fails "String#force_encoding with a special encoding name accepts valid special encoding names" # NoMethodError: undefined method `default_internal' for Encoding
166
- fails "String#force_encoding with a special encoding name defaults to ASCII-8BIT if special encoding name is not set" # NoMethodError: undefined method `default_internal' for Encoding
167
149
  fails "String#force_encoding with a special encoding name defaults to BINARY if special encoding name is not set" # NoMethodError: undefined method `default_internal' for Encoding
168
150
  fails "String#grapheme_clusters is unicode aware" # NoMethodError: undefined method `grapheme_clusters' for "Ç∂éƒg"
169
151
  fails "String#grapheme_clusters passes each char in self to the given block" # NoMethodError: undefined method `grapheme_clusters' for "hello"
@@ -172,7 +154,6 @@ opal_filter "String" do
172
154
  fails "String#grapheme_clusters returns an array when no block given" # NoMethodError: undefined method `grapheme_clusters' for "ab🏳️\u200D🌈🐾"
173
155
  fails "String#grapheme_clusters returns characters in the same encoding as self" # ArgumentError: unknown encoding name - Shift_JIS
174
156
  fails "String#grapheme_clusters returns self" # NoMethodError: undefined method `grapheme_clusters' for "ab🏳️\u200D🌈🐾"
175
- fails "String#grapheme_clusters taints resulting strings when self is tainted" # NoMethodError: undefined method `grapheme_clusters' for "hello"
176
157
  fails "String#grapheme_clusters uses the String's encoding to determine what characters it contains" # NoMethodError: undefined method `grapheme_clusters' for "𤭢"
177
158
  fails "String#grapheme_clusters works if the String's contents is invalid for its encoding" # Expected true to be false
178
159
  fails "String#grapheme_clusters works with multibyte characters" # NoMethodError: undefined method `grapheme_clusters' for "覇"
@@ -194,25 +175,22 @@ opal_filter "String" do
194
175
  fails "String#intern returns a US-ASCII Symbol for a binary String containing only US-ASCII characters" # Expected #<Encoding:UTF-16LE> to equal #<Encoding:ASCII-8BIT (dummy)>
195
176
  fails "String#intern returns a UTF-16LE Symbol for a UTF-16LE String containing non US-ASCII characters" # Error
196
177
  fails "String#intern returns a binary Symbol for a binary String containing non US-ASCII characters" # Expected #<Encoding:UTF-16LE> to equal #<Encoding:ASCII-8BIT (dummy)>
178
+ fails "String#length adds 1 (and not 2) for a incomplete surrogate in UTF-16" # Expected 2 == 1 to be truthy but was false
179
+ fails "String#length adds 1 for a broken sequence in UTF-32" # Expected 4 == 1 to be truthy but was false
197
180
  fails "String#length returns the correct length after force_encoding(BINARY)" # Expected 2 == 4 to be truthy but was false
198
- fails "String#lines when `chomp` keyword argument is passed ignores new line characters when separator is specified" # ArgumentError: [String#lines] wrong number of arguments(2 for -1)
199
- fails "String#lines when `chomp` keyword argument is passed removes new line characters when separator is not specified" # TypeError: no implicit conversion of Hash into String
200
- fails "String#lines when `chomp` keyword argument is passed removes new line characters" # TypeError: no implicit conversion of Hash into String
201
- fails "String#lines when `chomp` keyword argument is passed removes only specified separator" # ArgumentError: [String#lines] wrong number of arguments(2 for -1)
202
- fails "String#lines yields String instances for subclasses" # Expected [StringSpecs::MyString, StringSpecs::MyString] == [String, String] to be truthy but was false
203
- fails "String#lines yields paragraphs (broken by 2 or more successive newlines) when passed '' and replaces multiple newlines with only two ones" # Expected ["hello\nworld\n\n\n", "and\nuniverse\n\n\n\n\n"] to equal ["hello\nworld\n\n", "and\nuniverse\n\n"]
204
181
  fails "String#ljust with length, padding returns String instances when called on subclasses" # Expected " " (StringSpecs::MyString) to be an instance of String
205
182
  fails "String#next returns String instances when called on a subclass" # Expected "" (StringSpecs::MyString) to be an instance of String
183
+ fails "String#partition with String returns String instances when called on a subclass" # Expected "hello" (StringSpecs::MyString) to be an instance of String
206
184
  fails "String#rjust with length, padding returns String instances when called on subclasses" # Expected " " (StringSpecs::MyString) to be an instance of String
185
+ fails "String#rpartition with String returns String instances when called on a subclass" # Expected "hello" (StringSpecs::MyString) to be an instance of String
207
186
  fails "String#rpartition with String returns new object if doesn't match" # Expected "hello".equal? "hello" to be falsy but was true
208
- fails "String#scan with pattern and block passes block arguments as individual arguments when blocks are provided" # Expected ["a", "b", "c"] to equal "a"
187
+ fails "String#size adds 1 (and not 2) for a incomplete surrogate in UTF-16" # Expected 2 == 1 to be truthy but was false
188
+ fails "String#size adds 1 for a broken sequence in UTF-32" # Expected 4 == 1 to be truthy but was false
209
189
  fails "String#size returns the correct length after force_encoding(BINARY)" # Expected 2 == 4 to be truthy but was false
210
190
  fails "String#slice raises a RangeError if the index is too big" # Expected RangeError but no exception was raised (nil was returned)
211
191
  fails "String#slice with Range raises a RangeError if one of the bound is too big" # Expected RangeError but no exception was raised (nil was returned)
212
192
  fails "String#slice with Range raises a type error if a range is passed with a length" # Expected TypeError but no exception was raised ("el" was returned)
213
193
  fails "String#slice with Range returns String instances" # Expected "" (StringSpecs::MyString) to be an instance of String
214
- fails "String#slice with Range works with beginless ranges" # TypeError: no implicit conversion of NilClass into Integer
215
- fails "String#slice with Range works with endless ranges" # Opal::SyntaxError: undefined method `type' for nil
216
194
  fails "String#slice with Regexp returns String instances" # Expected "" (StringSpecs::MyString) to be an instance of String
217
195
  fails "String#slice with Regexp, index returns String instances" # Expected "he" (StringSpecs::MyString) to be an instance of String
218
196
  fails "String#slice with String returns a String instance when given a subclass instance" # Expected "el" (StringSpecs::MyString) to be an instance of String
@@ -234,6 +212,7 @@ opal_filter "String" do
234
212
  fails "String#split with Regexp when a block is given yields each split substring with empty regexp pattern" # Expected ["c", "h", "u", "n", "k", "y"] == "chunky" to be truthy but was false
235
213
  fails "String#split with Regexp when a block is given yields the string when limit is 1" # Expected ["chunky bacon"] == "chunky bacon" to be truthy but was false
236
214
  fails "String#split with String returns String instances based on self" # Expected "x" (StringSpecs::MyString) to be an instance of String
215
+ fails "String#split with String when $; is not nil warns" # Expected warning to match: /warning: \$; is set to non-nil value/ but got: ""
237
216
  fails "String#squeeze returns String instances when called on a subclass" # Expected "oh no!" (StringSpecs::MyString) to be an instance of String
238
217
  fails "String#sub with pattern, replacement returns String instances when called on a subclass" # Expected "" (StringSpecs::MyString) to be an instance of String
239
218
  fails "String#sub with pattern, replacement returns a copy of self when no modification is made" # Expected "hello" not to be identical to "hello"
@@ -247,7 +226,6 @@ opal_filter "String" do
247
226
  fails "String#swapcase full Unicode case mapping updates string metadata" # Expected "aßET" to equal "aSSET"
248
227
  fails "String#swapcase full Unicode case mapping works for all of Unicode with no option" # Expected "äÖü" to equal "ÄöÜ"
249
228
  fails "String#swapcase returns String instances when called on a subclass" # Expected "" (StringSpecs::MyString) to be an instance of String
250
- fails "String#swapcase works for all of Unicode" # Expected "äÖü" to equal "ÄöÜ"
251
229
  fails "String#to_sym raises an EncodingError for UTF-8 String containing invalid bytes" # Expected true to equal false
252
230
  fails "String#to_sym returns a US-ASCII Symbol for a UTF-8 String containing only US-ASCII characters" # Expected #<Encoding:UTF-16LE> to equal #<Encoding:ASCII-8BIT (dummy)>
253
231
  fails "String#to_sym returns a US-ASCII Symbol for a binary String containing only US-ASCII characters" # Expected #<Encoding:UTF-16LE> to equal #<Encoding:ASCII-8BIT (dummy)>
@@ -276,12 +254,9 @@ opal_filter "String" do
276
254
  fails "String#undump returns a string with special characters in \\<char> notation replaced with the characters" # NoMethodError: undefined method `undump' for "\"\\a\""
277
255
  fails "String#undump returns a string with unescaped sequences \" and \\" # NoMethodError: undefined method `undump' for "\"\\\"\""
278
256
  fails "String#undump returns a string with unescaped sequences \\#<char> when # is followed by $, @, {" # NoMethodError: undefined method `undump' for "\"\\\#$PATH\""
279
- fails "String#undump returns a string with unescaped sequencies \" and \\" # NoMethodError: undefined method `undump' for "\"\\\"\""
280
257
  fails "String#undump returns a string with upper-case alpha characters unescaped" # NoMethodError: undefined method `undump' for "\"A\""
281
258
  fails "String#undump strips outer \"" # NoMethodError: undefined method `undump' for "\"foo\""
282
- fails "String#undump taints the result if self is tainted" # NoMethodError: undefined method `undump' for "\"foo\""
283
259
  fails "String#undump undumps correctly string produced from non ASCII-compatible one" # NoMethodError: undefined method `dump' for "ࡶ"
284
- fails "String#undump untrusts the result if self is untrusted" # NoMethodError: undefined method `untrust' for "\"foo\""
285
260
  fails "String#unicode_normalize raises an Encoding::CompatibilityError if string is not in an unicode encoding" # ArgumentError: unknown encoding name - ISO-8859-1
286
261
  fails "String#unicode_normalized? raises an Encoding::CompatibilityError if the string is not in an unicode encoding" # ArgumentError: unknown encoding name - ISO-8859-1
287
262
  fails "String#unicode_normalized? returns true if str is in Unicode normalization form (nfc)" # Expected true to be false
@@ -290,6 +265,7 @@ opal_filter "String" do
290
265
  fails "String#unicode_normalized? returns true if str is in Unicode normalization form (nfkd)" # Expected true to be false
291
266
  fails "String#unpack with format 'm' when given count 0 raises an ArgumentError for an invalid base64 character" # Expected ArgumentError but no exception was raised (["test"] was returned)
292
267
  fails "String#unpack1 returns the first value of #unpack" # RuntimeError: Unsupported unpack directive "x" (no chunk reader defined)
268
+ fails "String#unpack1 starts unpacking from the given offset" # RuntimeError: Unsupported unpack directive "x" (no chunk reader defined)
293
269
  fails "String#upcase ASCII-only case mapping does not upcase non-ASCII characters" # ArgumentError: [String#upcase] wrong number of arguments(1 for 0)
294
270
  fails "String#upcase full Unicode case mapping adapted for Lithuanian allows Turkic as an extra option (and applies Turkic semantics)" # ArgumentError: [String#upcase] wrong number of arguments(2 for 0)
295
271
  fails "String#upcase full Unicode case mapping adapted for Lithuanian currently works the same as full Unicode case mapping" # ArgumentError: [String#upcase] wrong number of arguments(1 for 0)
@@ -299,5 +275,4 @@ opal_filter "String" do
299
275
  fails "String#valid_encoding? returns true for IBM720 encoding self is valid in" # ArgumentError: unknown encoding name - IBM720
300
276
  fails "String.new accepts an encoding argument" # ArgumentError: [String.new] wrong number of arguments(2 for -1)
301
277
  fails "String.new is called on subclasses" # Expected nil to equal "subclass"
302
- 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))
303
278
  end
@@ -2,24 +2,23 @@
2
2
  opal_filter "StringScanner" do
3
3
  fails "StringScanner#<< concatenates the given argument to self and returns self"
4
4
  fails "StringScanner#<< raises a TypeError if the given argument can't be converted to a String"
5
- fails "StringScanner#<< when passed a Fixnum doesn't call to_int on the argument"
6
- fails "StringScanner#<< when passed a Fixnum raises a TypeError"
7
5
  fails "StringScanner#<< when passed an Integer doesn't call to_int on the argument" # Expected TypeError but got: NoMethodError (undefined method `<<' for #<StringScanner:0x28c>)
8
6
  fails "StringScanner#<< when passed an Integer raises a TypeError" # Expected TypeError but got: NoMethodError (undefined method `<<' for #<StringScanner:0x290>)
9
7
  fails "StringScanner#[] raises a IndexError when there's no named capture"
10
8
  fails "StringScanner#[] returns named capture"
9
+ fails "StringScanner#check treats String as the pattern itself" # Expected nil == "This" to be truthy but was false
10
+ fails "StringScanner#check_until raises TypeError if given a String" # Expected TypeError (wrong argument type String (expected Regexp)) but no exception was raised (nil was returned)
11
11
  fails "StringScanner#clear set the scan pointer to the end of the string and clear matching data."
12
12
  fails "StringScanner#clear warns in verbose mode that the method is obsolete"
13
13
  fails "StringScanner#concat concatenates the given argument to self and returns self"
14
14
  fails "StringScanner#concat raises a TypeError if the given argument can't be converted to a String"
15
- fails "StringScanner#concat when passed a Fixnum doesn't call to_int on the argument"
16
- fails "StringScanner#concat when passed a Fixnum raises a TypeError"
17
15
  fails "StringScanner#concat when passed an Integer doesn't call to_int on the argument" # Expected TypeError but got: NoMethodError (undefined method `concat' for #<StringScanner:0x362>)
18
16
  fails "StringScanner#concat when passed an Integer raises a TypeError" # Expected TypeError but got: NoMethodError (undefined method `concat' for #<StringScanner:0x366>)
19
17
  fails "StringScanner#dup copies previous match state"
20
18
  fails "StringScanner#empty? returns false if the scan pointer is not at the end of the string" # NoMethodError: undefined method `empty?' for #<StringScanner:0x726>
21
19
  fails "StringScanner#empty? returns true if the scan pointer is at the end of the string" # NoMethodError: undefined method `empty?' for #<StringScanner:0x72a>
22
20
  fails "StringScanner#empty? warns in verbose mode that the method is obsolete"
21
+ fails "StringScanner#exist? raises TypeError if given a String" # Expected TypeError (wrong argument type String (expected Regexp)) but got: Exception (pattern.exec is not a function)
23
22
  fails "StringScanner#getbyte is not multi-byte character sensitive"
24
23
  fails "StringScanner#getbyte returns an instance of String when passed a String subclass"
25
24
  fails "StringScanner#getbyte returns nil at the end of the string"
@@ -39,7 +38,6 @@ opal_filter "StringScanner" do
39
38
  fails "StringScanner#peep returns an empty string when the passed argument is zero"
40
39
  fails "StringScanner#peep returns an instance of String when passed a String subclass"
41
40
  fails "StringScanner#peep returns at most the specified number of bytes from the current position" # NoMethodError: undefined method `peep' for #<StringScanner:0x590>
42
- fails "StringScanner#peep returns at most the specified number of characters from the current position"
43
41
  fails "StringScanner#peep warns in verbose mode that the method is obsolete"
44
42
  fails "StringScanner#pointer returns 0 in the reset position"
45
43
  fails "StringScanner#pointer returns the length of the string in the terminate position"
@@ -54,9 +52,7 @@ opal_filter "StringScanner" do
54
52
  fails "StringScanner#restsize is equivalent to rest.size"
55
53
  fails "StringScanner#restsize returns the length of the rest of the string" # NoMethodError: undefined method `restsize' for #<StringScanner:0x4a4>
56
54
  fails "StringScanner#restsize warns in verbose mode that the method is obsolete"
57
- fails "StringScanner#scan raises a TypeError if pattern is a String" # Expected TypeError but no exception was raised (nil was returned)
58
55
  fails "StringScanner#scan raises a TypeError if pattern isn't a Regexp nor String" # Expected TypeError but no exception was raised (nil was returned)
59
- fails "StringScanner#scan raises a TypeError if pattern isn't a Regexp"
60
56
  fails "StringScanner#scan treats String as the pattern itself" # Expected nil == "This" to be truthy but was false
61
57
  fails "StringScanner#scan with fixed_anchor: true returns the matched string" # ArgumentError: [StringScanner#initialize] wrong number of arguments(2 for 1)
62
58
  fails "StringScanner#scan with fixed_anchor: true treats \\A as matching from the beginning of string" # ArgumentError: [StringScanner#initialize] wrong number of arguments(2 for 1)
@@ -65,10 +61,15 @@ opal_filter "StringScanner" do
65
61
  fails "StringScanner#scan_full returns the matched string if the third argument is true"
66
62
  fails "StringScanner#scan_full returns the number of bytes advanced and advances the scan pointer if the second argument is true"
67
63
  fails "StringScanner#scan_full returns the number of bytes advanced"
64
+ fails "StringScanner#scan_until raises TypeError if given a String" # Expected TypeError (wrong argument type String (expected Regexp)) but no exception was raised (nil was returned)
65
+ fails "StringScanner#search_full raises TypeError if given a String" # Expected TypeError (wrong argument type String (expected Regexp)) but got: NoMethodError (undefined method `search_full' for #<StringScanner:0x196 @string="This is a test" @pos=0 @matched=nil @working="This is a test" @match=[]>)
68
66
  fails "StringScanner#search_full returns the matched string if the third argument is true and advances the scan pointer if the second argument is true"
69
67
  fails "StringScanner#search_full returns the matched string if the third argument is true"
70
68
  fails "StringScanner#search_full returns the number of bytes advanced and advances the scan pointer if the second argument is true"
71
69
  fails "StringScanner#search_full returns the number of bytes advanced"
70
+ fails "StringScanner#size returns nil if there is no last match" # NoMethodError: undefined method `size' for #<StringScanner:0x9e0d6 @string="This is a test" @pos=0 @matched=nil @working="This is a test" @match=[]>
71
+ fails "StringScanner#size returns the number of captures groups of the last match" # NoMethodError: undefined method `size' for #<StringScanner:0x9e0dc @string="This is a test" @pos=3 @matched="Thi" @working="s is a test" @match=["Thi", "T", "h", "i"] @prev_pos=0>
72
+ fails "StringScanner#skip_until raises TypeError if given a String" # Expected TypeError (wrong argument type String (expected Regexp)) but no exception was raised (nil was returned)
72
73
  fails "StringScanner#string returns the string being scanned"
73
74
  fails "StringScanner#string= changes the string being scanned to the argument and resets the scanner"
74
75
  fails "StringScanner#string= converts the argument into a string using #to_str"
@@ -1,10 +1,7 @@
1
1
  # NOTE: run bin/format-filters after changing this file
2
2
  opal_filter "Struct" do
3
3
  fails "Struct#dig returns the value by the index" # Expected nil == "one" to be truthy but was false
4
- fails "Struct#hash returns different hashes for different struct classes" # Expected "Hash" != "Hash" to be truthy but was false
5
4
  fails "Struct#hash returns different hashes for structs with different values when using keyword_init: true" # NameError: wrong constant name 1 non symbol member
6
- fails "Struct#hash returns different hashes for structs with different values" # Expected "Hash" == "Hash" to be falsy but was true
7
- fails "Struct#hash returns the same fixnum for structs with the same content"
8
5
  fails "Struct#hash returns the same integer for structs with the same content" # Expected "Hash" (String) to be kind of Integer
9
6
  fails "Struct#to_h with block coerces returned pair to Array with #to_ary" # Expected {"make"=>nil, "model"=>nil, "year"=>nil} == {"b"=>"b"} to be truthy but was false
10
7
  fails "Struct#to_h with block converts [key, value] pairs returned by the block to a hash" # Expected {"make"=>"Ford", "model"=>"Ranger", "year"=>nil} == {"make"=>"ford", "model"=>"ranger", "year"=>""} to be truthy but was false
@@ -15,4 +12,6 @@ opal_filter "Struct" do
15
12
  fails "Struct.new keyword_init: true option raises when there is a duplicate member" # Expected ArgumentError (duplicate member: foo) but no exception was raised (#<Class:0x294> was returned)
16
13
  fails "Struct.new raises ArgumentError when there is a duplicate member" # Expected ArgumentError (duplicate member: foo) but no exception was raised (#<Class:0x256> was returned)
17
14
  fails "Struct.new raises a ArgumentError if passed a Hash with an unknown key" # Just like "def m(a: nil); end; m(b: nil)" doesn't raise an error. That's a bug in the handling of kwargs
15
+ fails_badly "Struct#hash returns different hashes for different struct classes" # A failure in Chromium that once passes, other times it doesn't, most probably related to some kind of undeterminism.
16
+ fails_badly "Struct#hash returns different hashes for structs with different values" # Ditto
18
17
  end
@@ -1,7 +1,6 @@
1
1
  # NOTE: run bin/format-filters after changing this file
2
2
  opal_filter "Symbol" do
3
3
  fails "Symbol#to_proc produces a Proc that always returns [[:req], [:rest]] for #parameters" # Expected [["rest", "args"], ["block", "block"]] == [["req"], ["rest"]] to be truthy but was false
4
- fails "Symbol#to_proc produces a Proc that always returns [[:rest]] for #parameters" # Expected [["rest", "args"], ["block", "block"]] == [["rest"]] to be truthy but was false
5
4
  fails "Symbol#to_proc produces a Proc with arity -2" # Expected -1 == -2 to be truthy but was false
6
5
  fails "Symbol#to_proc returns a Proc with #lambda? true" # Expected #<Proc:0xd6f0>.lambda? to be truthy but was false
7
6
  end
@@ -25,11 +25,9 @@ opal_filter "Time" do
25
25
  fails "Time#getlocal with a timezone argument subject's class implements .find_timezone method does not call .find_timezone if passed any not string/numeric/timezone timezone argument" # Expected TypeError (/can't convert \w+ into an exact number/) but got: NoMethodError (undefined method `getlocal' for 2000-01-01 12:00:00 UTC)
26
26
  fails "Time#gmtime converts self to UTC, modifying the receiver" # Expected 2007-01-09 03:00:00 UTC to equal 2007-01-09 12:00:00 UTC
27
27
  fails "Time#hash returns an Integer" # Expected "Time:100000" (String) to be an instance of Integer
28
- fails "Time#inspect formats nanoseconds as a Rational" # NoMethodError: undefined method `nsec' for 2007-11-01 15:25:00 UTC
29
28
  fails "Time#inspect formats the fixed offset time following the pattern 'yyyy-MM-dd HH:mm:ss +/-HHMM'"
30
29
  fails "Time#inspect omits trailing zeros from microseconds" # Expected "2007-11-01 15:25:00 UTC" == "2007-11-01 15:25:00.1 UTC" to be truthy but was false
31
30
  fails "Time#inspect preserves microseconds" # Expected "2007-11-01 15:25:00 UTC" == "2007-11-01 15:25:00.123456 UTC" to be truthy but was false
32
- fails "Time#inspect preserves milliseconds" # Expected "2007-11-01 15:25:00 UTC" == "2007-11-01 15:25:00.123456 UTC" to be truthy but was false
33
31
  fails "Time#inspect preserves nanoseconds" # Expected "2007-11-01 15:25:00 UTC" == "2007-11-01 15:25:00.123456789 UTC" to be truthy but was false
34
32
  fails "Time#inspect uses the correct time zone with microseconds" # NoMethodError: undefined method `localtime' for 2000-01-01 00:00:00 UTC
35
33
  fails "Time#inspect uses the correct time zone without microseconds" # NoMethodError: undefined method `localtime' for 2000-01-01 00:00:00 UTC
@@ -55,7 +53,6 @@ opal_filter "Time" do
55
53
  fails "Time#strftime with %N formats the nanoseconds of the second with %N"
56
54
  fails "Time#strftime with %N formats the picoseconds of the second with %12N"
57
55
  fails "Time#subsec returns 0 as an Integer for a Time with a whole number of seconds" # NoMethodError: undefined method `subsec' for 1970-01-01 01:01:40 +0100
58
- fails "Time#succ is obsolete" # Expected warning to match: /Time#succ is obsolete/ but got: ""
59
56
  fails "Time#to_f returns the float number of seconds + usecs since the epoch"
60
57
  fails "Time#to_i rounds fractional seconds toward zero" # Expected -315619200 == -315619199 to be truthy but was false
61
58
  fails "Time#to_s formats the fixed offset time following the pattern 'yyyy-MM-dd HH:mm:ss +/-HHMM'"
@@ -71,15 +68,10 @@ opal_filter "Time" do
71
68
  fails "Time.at passed Numeric passed Rational returns Time with correct microseconds" # Expected 0 == 539759 to be truthy but was false
72
69
  fails "Time.at passed Numeric passed Rational returns Time with correct nanoseconds" # Expected 0 == 539759 to be truthy but was false
73
70
  fails "Time.at passed Numeric roundtrips a Rational produced by #to_r"
74
- fails "Time.at passed [Time, Numeric, format] :microsecond format traits second argument as microseconds" # ArgumentError: [Time.at] wrong number of arguments(3 for -2)
75
71
  fails "Time.at passed [Time, Numeric, format] :microsecond format treats second argument as microseconds" # ArgumentError: [Time.at] wrong number of arguments(3 for -2)
76
- fails "Time.at passed [Time, Numeric, format] :millisecond format traits second argument as milliseconds" # ArgumentError: [Time.at] wrong number of arguments(3 for -2)
77
72
  fails "Time.at passed [Time, Numeric, format] :millisecond format treats second argument as milliseconds" # ArgumentError: [Time.at] wrong number of arguments(3 for -2)
78
- fails "Time.at passed [Time, Numeric, format] :nanosecond format traits second argument as nanoseconds" # ArgumentError: [Time.at] wrong number of arguments(3 for -2)
79
73
  fails "Time.at passed [Time, Numeric, format] :nanosecond format treats second argument as nanoseconds" # ArgumentError: [Time.at] wrong number of arguments(3 for -2)
80
- fails "Time.at passed [Time, Numeric, format] :nsec format traits second argument as nanoseconds" # ArgumentError: [Time.at] wrong number of arguments(3 for -2)
81
74
  fails "Time.at passed [Time, Numeric, format] :nsec format treats second argument as nanoseconds" # ArgumentError: [Time.at] wrong number of arguments(3 for -2)
82
- fails "Time.at passed [Time, Numeric, format] :usec format traits second argument as microseconds" # ArgumentError: [Time.at] wrong number of arguments(3 for -2)
83
75
  fails "Time.at passed [Time, Numeric, format] :usec format treats second argument as microseconds" # ArgumentError: [Time.at] wrong number of arguments(3 for -2)
84
76
  fails "Time.at passed [Time, Numeric, format] supports Float second argument" # ArgumentError: [Time.at] wrong number of arguments(3 for -2)
85
77
  fails "Time.at passed non-Time, non-Numeric with an argument that responds to #to_r needs for the argument to respond to #to_int too" # Mock 'rational-but-no-to_int' expected to receive to_r("any_args") exactly 1 times but received it 0 times
@@ -5,15 +5,7 @@ opal_filter "UnboundMethod" do
5
5
  fails "UnboundMethod#== returns true if objects refer to the same method"
6
6
  fails "UnboundMethod#== returns true if same method is extracted from the same subclass"
7
7
  fails "UnboundMethod#arity for a Method generated by respond_to_missing? returns -1"
8
- fails "UnboundMethod#bind returns Method returned for obj is equal to one directly returned by obj.method" # Expected #<Method: UnboundMethodSpecs::Methods#foo (defined in UnboundMethodSpecs::Methods in ruby/core/unboundmethod/fixtures/classes.rb:30)> to equal #<Method: UnboundMethodSpecs::Methods#foo (defined in UnboundMethodSpecs::Methods in ruby/core/unboundmethod/fixtures/classes.rb:30)>
9
8
  fails "UnboundMethod#bind the returned Method is equal to the one directly returned by obj.method" # Expected #<Method: UnboundMethodSpecs::Methods#foo (defined in UnboundMethodSpecs::Methods in ruby/core/unboundmethod/fixtures/classes.rb:30)> to equal #<Method: UnboundMethodSpecs::Methods#foo (defined in UnboundMethodSpecs::Methods in ruby/core/unboundmethod/fixtures/classes.rb:30)>
10
- fails "UnboundMethod#bind_call binds and calls a Kernel method retrieved from Object on BasicObject" # NoMethodError: undefined method `bind_call' for #<UnboundMethod: Object#instance_of? (defined in Kernel in <internal:corelib/kernel.rb>:253)>
11
- fails "UnboundMethod#bind_call binds and calls a Parent's class method to any Child's class methods" # NoMethodError: undefined method `bind_call' for #<UnboundMethod: Class#class_method (defined in #<Class:UnboundMethodSpecs::Parent> in ruby/core/unboundmethod/fixtures/classes.rb:60)>
12
- fails "UnboundMethod#bind_call binds and calls the method for any object kind_of? the Module the method is defined in" # NoMethodError: undefined method `bind_call' for #<UnboundMethod: UnboundMethodSpecs::Parent#foo (defined in UnboundMethodSpecs::Parent in ruby/core/unboundmethod/fixtures/classes.rb:59)>
13
- fails "UnboundMethod#bind_call binds and calls the method if object is kind_of the Module the method defined in" # NoMethodError: undefined method `bind_call' for #<UnboundMethod: UnboundMethodSpecs::Methods#foo (defined in UnboundMethodSpecs::Methods in ruby/core/unboundmethod/fixtures/classes.rb:30)>
14
- fails "UnboundMethod#bind_call binds and calls the method on any object when UnboundMethod is unbound from a module" # NoMethodError: undefined method `bind_call' for #<UnboundMethod: UnboundMethodSpecs::Mod#from_mod (defined in UnboundMethodSpecs::Mod in ruby/core/unboundmethod/fixtures/classes.rb:24)>
15
- fails "UnboundMethod#bind_call raises TypeError if object is not kind_of? the Module the method defined in" # Expected TypeError but got: NoMethodError (undefined method `bind_call' for #<UnboundMethod: UnboundMethodSpecs::Methods#foo (defined in UnboundMethodSpecs::Methods in ruby/core/unboundmethod/fixtures/classes.rb:30)>)
16
- fails "UnboundMethod#bind_call will raise when binding a an object singleton's method to another object" # Expected TypeError but got: NoMethodError (undefined method `bind_call' for #<UnboundMethod: UnboundMethodSpecs::Parent#singleton_method (defined in #<Class:#<UnboundMethodSpecs::Parent:0x30e3e>> in ruby/core/unboundmethod/bind_call_spec.rb:44)>)
17
9
  fails "UnboundMethod#clone returns a copy of the UnboundMethod"
18
10
  fails "UnboundMethod#hash returns the same value for builtin methods that are eql?"
19
11
  fails "UnboundMethod#hash returns the same value for user methods that are eql?"
@@ -4,7 +4,6 @@ opal_filter "warnings" do
4
4
  fails "Constant resolution within methods with dynamically assigned constants returns the updated value when a constant is reassigned" # Expected warning to match: /already initialized constant/
5
5
  fails "Fixnum is deprecated" # Expected warning to match: /constant ::Fixnum is deprecated/ but got: ""
6
6
  fails "Hash#fetch gives precedence to the default block over the default argument when passed both" # Expected warning to match: /block supersedes default value argument/
7
- fails "Hash.[] ignores elements that are not arrays" # Expected warning to match: /ignoring wrong elements/
8
7
  fails "Integer#** bignum switch to a Float when the values is too big" # Expected warning to match: /warning: in a\*\*b, b may be too big/ but got: ""
9
8
  fails "Integer#** fixnum returns Float::INFINITY when the number is too big" # Expected warning to match: /warning: in a\*\*b, b may be too big/ but got: ""
10
9
  fails "Integer#pow one argument is passed fixnum returns Float::INFINITY when the number is too big" # Expected warning to match: /warning: in a\*\*b, b may be too big/ but got: ""
@@ -12,15 +11,10 @@ opal_filter "warnings" do
12
11
  fails "Literal (A::X) constant resolution with dynamically assigned constants returns the updated value when a constant is reassigned" # Expected warning to match: /already initialized constant/
13
12
  fails "Literal Regexps matches against $_ (last input) in a conditional if no explicit matchee provided" # Expected warning to match: /regex literal in condition/
14
13
  fails "Module#const_get with dynamically assigned constants returns the updated value of a constant" # Expected warning to match: /already initialized constant/
15
- fails "Optional variable assignments using compunded constants with &&= assignments" # Expected warning to match: /already initialized constant/
16
- fails "Optional variable assignments using compunded constants with operator assignments" # Expected warning to match: /already initialized constant/
14
+ fails "Pattern matching warning when one-line form does not warn about pattern matching is experimental feature" # NameError: uninitialized constant Warning
17
15
  fails "Predefined global $, warns if assigned non-nil" # Expected warning to match: /warning: `\$,' is deprecated/ but got: ""
18
16
  fails "Predefined global $; warns if assigned non-nil" # Expected warning to match: /warning: `\$;' is deprecated/ but got: ""
19
17
  fails "Regexp.new given a Regexp does not honour options given as additional arguments" # Expected warning to match: /flags ignored/
20
- fails "String#split with String when $; is not nil warns" # Expected warning to match: /warning: \$; is set to non-nil value/ but got: ""
21
18
  fails "Struct.new overwrites previously defined constants with string as first argument" # Expected warning to match: /redefining constant/
22
19
  fails "The for expression allows a constant as an iterator name" # Expected warning to match: /already initialized constant/
23
- fails "The predefined global constants includes FALSE" # Expected warning to match: /constant ::FALSE is deprecated/
24
- fails "The predefined global constants includes NIL" # Expected warning to match: /constant ::NIL is deprecated/
25
- fails "The predefined global constants includes TRUE" # Expected warning to match: /constant ::TRUE is deprecated/
26
20
  end
@@ -71,7 +71,9 @@ opal_unsupported_filter "freezing" do
71
71
  fails "Array#unshift raises a FrozenError on a frozen array when the array would not be modified" # Expected FrozenError but no exception was raised ([1, 2, 3] was returned)
72
72
  fails "Date constants freezes MONTHNAMES, DAYNAMES, ABBR_MONTHNAMES, ABBR_DAYSNAMES"
73
73
  fails "Enumerable#sort doesn't raise an error if #to_a returns a frozen Array"
74
+ fails "Enumerable#tally with a hash raises a FrozenError and does not update the given hash when the hash is frozen" # Expected FrozenError but got: ArgumentError ([Numerous#tally] wrong number of arguments(1 for 0))
74
75
  fails "Enumerator#initialize on frozen instance raises a RuntimeError"
76
+ fails "Enumerator::Chain#initialize on frozen instance raises a RuntimeError" # Expected RuntimeError but no exception was raised (#<Enumerator::Chain: []> was returned)
75
77
  fails "Enumerator::Generator#initialize on frozen instance raises a RuntimeError" # Expected RuntimeError but no exception was raised (#<Proc:0x1b314> was returned)
76
78
  fails "Enumerator::Lazy#initialize on frozen instance raises a RuntimeError" # Expected RuntimeError but no exception was raised (nil was returned)
77
79
  fails "FalseClass#to_s returns a frozen string" # Expected "false".frozen? to be truthy but was false
@@ -131,6 +133,17 @@ opal_unsupported_filter "freezing" do
131
133
  fails "Kernel#clone copies frozen? and tainted?" # Expected false to be true
132
134
  fails "Kernel#clone takes an freeze: true option to frozen copy" # Expected #<KernelSpecs::Duplicate:0x25158>.frozen? to be truthy but was false
133
135
  fails "Kernel#clone takes an option to copy freeze state or not" # TODO: move to unsupported/freeze
136
+ fails "Kernel#clone with freeze: anything else raises ArgumentError when passed not true/false/nil" # Expected ArgumentError (/unexpected value for freeze: Integer/) but no exception was raised (#<KernelSpecs::Duplicate:0x22130 @one=1 @two="a"> was returned)
137
+ fails "Kernel#clone with freeze: false calls #initialize_clone with kwargs freeze: false even if #initialize_clone only takes a single argument" # Expected ArgumentError (wrong number of arguments (given 2, expected 1)) but no exception was raised (#<KernelSpecs::Clone:0x220b2> was returned)
138
+ fails "Kernel#clone with freeze: false calls #initialize_clone with kwargs freeze: false" # Expected [#<KernelSpecs::CloneFreeze:0x220d0>, {}] == [#<KernelSpecs::CloneFreeze:0x220d0>, {"freeze"=>false}] to be truthy but was false
139
+ fails "Kernel#clone with freeze: nil copies frozen state from the original, like #clone without arguments" # Expected #<KernelSpecs::Duplicate:0x21fd4 @one=1 @two="a">.frozen? to be truthy but was false
140
+ fails "Kernel#clone with freeze: nil copies frozen?" # ArgumentError: [String#clone] wrong number of arguments(1 for 0)
141
+ fails "Kernel#clone with freeze: true calls #initialize_clone with kwargs freeze: true even if #initialize_clone only takes a single argument" # Expected ArgumentError (wrong number of arguments (given 2, expected 1)) but no exception was raised (#<KernelSpecs::Clone:0x21ffa> was returned)
142
+ fails "Kernel#clone with freeze: true calls #initialize_clone with kwargs freeze: true" # Expected [#<KernelSpecs::CloneFreeze:0x22050>, {}] == [#<KernelSpecs::CloneFreeze:0x22050>, {"freeze"=>true}] to be truthy but was false
143
+ fails "Kernel#clone with freeze: true freezes the copy even if the original was not frozen" # Expected #<KernelSpecs::Duplicate:0x2200c @one=1 @two="a">.frozen? to be truthy but was false
144
+ fails "Kernel#clone with freeze: true makes a frozen copy if the original is frozen" # Expected #<KernelSpecs::Duplicate:0x2202e @one=1 @two="a">.frozen? to be truthy but was false
145
+ fails "Kernel#clone with no arguments copies frozen state from the original" # Expected #<KernelSpecs::Duplicate:0x21faa @one=1 @two="a">.frozen? to be truthy but was false
146
+ fails "Kernel#clone with no arguments copies frozen?" # Expected false to be true
134
147
  fails "Kernel#extend on frozen instance raises a FrozenError" # Expected FrozenError but no exception was raised (main was returned)
135
148
  fails "Kernel#extend on frozen instance raises a RuntimeError"
136
149
  fails "Kernel#extend on frozen instance raises an ArgumentError when no arguments given"
@@ -153,12 +166,23 @@ opal_unsupported_filter "freezing" do
153
166
  fails "Kernel#frozen? on integers returns true"
154
167
  fails "Kernel#frozen? on true, false and nil returns true"
155
168
  fails "Kernel#frozen? returns true if self is frozen"
169
+ fails "Kernel#initialize_clone accepts a :freeze keyword argument for obj.clone(freeze: value)" # ArgumentError: [Object#initialize_clone] wrong number of arguments(2 for 1)
156
170
  fails "Kernel#instance_variable_set on frozen objects keeps stored object after any exceptions"
157
171
  fails "Kernel#instance_variable_set on frozen objects raises a FrozenError when passed replacement is different from stored object" # Expected FrozenError but no exception was raised ("replacement" was returned)
158
172
  fails "Kernel#instance_variable_set on frozen objects raises a FrozenError when passed replacement is identical to stored object" # Expected FrozenError but no exception was raised ("origin" was returned)
159
173
  fails "Kernel#instance_variable_set on frozen objects raises a RuntimeError when passed replacement is different from stored object"
160
174
  fails "Kernel#instance_variable_set on frozen objects raises a RuntimeError when passed replacement is identical to stored object"
175
+ fails "Literal Ranges is frozen" # Expected 42...frozen? to be truthy but was false
161
176
  fails "Literal Regexps is frozen" # Expected /Hello/.frozen? to be truthy but was false
177
+ fails "Marshal.load when called with freeze: true does not freeze classes" # ArgumentError: [Marshal.load] wrong number of arguments(2 for 1)
178
+ fails "Marshal.load when called with freeze: true does not freeze modules" # ArgumentError: [Marshal.load] wrong number of arguments(2 for 1)
179
+ fails "Marshal.load when called with freeze: true returns frozen arrays" # ArgumentError: [Marshal.load] wrong number of arguments(2 for 1)
180
+ fails "Marshal.load when called with freeze: true returns frozen hashes" # ArgumentError: [Marshal.load] wrong number of arguments(2 for 1)
181
+ fails "Marshal.load when called with freeze: true returns frozen objects" # ArgumentError: [Marshal.load] wrong number of arguments(2 for 1)
182
+ fails "Marshal.load when called with freeze: true returns frozen regexps" # ArgumentError: [Marshal.load] wrong number of arguments(2 for 1)
183
+ fails "Marshal.load when called with freeze: true returns frozen strings" # ArgumentError: [Marshal.load] wrong number of arguments(2 for 1)
184
+ fails "Marshal.load when called with freeze: true when called with a proc call the proc with frozen objects" # ArgumentError: [Marshal.load] wrong number of arguments(3 for 1)
185
+ fails "Marshal.load when called with freeze: true when called with a proc does not freeze the object returned by the proc" # ArgumentError: [Marshal.load] wrong number of arguments(3 for 1)
162
186
  fails "MatchData#string returns a frozen copy of the match string"
163
187
  fails "Module#alias_method raises FrozenError if frozen" # Expected FrozenError but no exception was raised (#<Class:0x39d44> was returned)
164
188
  fails "Module#alias_method raises RuntimeError if frozen"
@@ -97,6 +97,7 @@ opal_unsupported_filter "Integer" do
97
97
  fails "Integer#| bignum returns self bitwise OR other when one operand is negative" # Expected 0 to equal -64563604257983430000
98
98
  fails "Integer#| bignum returns self bitwise OR other" # Expected 2 to equal 9223372036854776000
99
99
  fails "Integer#~ bignum returns self with each bit flipped" # Expected -1 to equal -9223372036854776000
100
+ fails "Numeric#quo raises a ZeroDivisionError if the given argument is zero and not a Float" # Expected ZeroDivisionError but no exception was raised (Infinity was returned)
100
101
  fails "String#to_r does not treat a leading period without a numeric prefix as a decimal point" # Expected (8106479329266893/9007199254740992) not to equal (8106479329266893/9007199254740992)
101
102
  fails "String#to_r ignores underscores between numbers" # Expected (-5228919960423629/274877906944) to equal (-190227/10)
102
103
  fails "String#to_r understands a forward slash as separating the numerator from the denominator" # Expected (-896028675862255/140737488355328) to equal (-191/30)