opal 1.6.1 → 1.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (212) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/build.yml +17 -0
  3. data/CHANGELOG.md +35 -1
  4. data/Gemfile +1 -0
  5. data/HACKING.md +47 -26
  6. data/benchmark/benchmarks +415 -103
  7. data/benchmark/bm_call_overhead.yml +28 -0
  8. data/benchmark/run.rb +61 -40
  9. data/docs/cdp_common.json +3364 -0
  10. data/docs/cdp_common.md +18 -0
  11. data/docs/{headless_chrome.md → headless_browsers.md} +31 -12
  12. data/lib/opal/ast/builder.rb +1 -1
  13. data/lib/opal/builder.rb +6 -1
  14. data/lib/opal/builder_processors.rb +5 -3
  15. data/lib/opal/cache.rb +1 -7
  16. data/lib/opal/cli_options.rb +72 -58
  17. data/lib/opal/cli_runners/chrome.rb +47 -9
  18. data/lib/opal/cli_runners/chrome_cdp_interface.rb +238 -112
  19. data/lib/opal/cli_runners/compiler.rb +146 -13
  20. data/lib/opal/cli_runners/deno.rb +32 -0
  21. data/lib/opal/cli_runners/firefox.rb +350 -0
  22. data/lib/opal/cli_runners/firefox_cdp_interface.rb +212 -0
  23. data/lib/opal/cli_runners/node_modules/.bin/chrome-remote-interface.cmd +17 -0
  24. data/lib/opal/cli_runners/node_modules/.bin/chrome-remote-interface.ps1 +28 -0
  25. data/lib/opal/cli_runners/node_modules/.package-lock.json +41 -0
  26. data/lib/opal/cli_runners/node_modules/chrome-remote-interface/LICENSE +1 -1
  27. data/lib/opal/cli_runners/node_modules/chrome-remote-interface/README.md +322 -182
  28. data/lib/opal/cli_runners/node_modules/chrome-remote-interface/bin/client.js +99 -114
  29. data/lib/opal/cli_runners/node_modules/chrome-remote-interface/chrome-remote-interface.js +1 -11
  30. data/lib/opal/cli_runners/node_modules/chrome-remote-interface/index.js +16 -11
  31. data/lib/opal/cli_runners/node_modules/chrome-remote-interface/lib/api.js +41 -33
  32. data/lib/opal/cli_runners/node_modules/chrome-remote-interface/lib/chrome.js +224 -214
  33. data/lib/opal/cli_runners/node_modules/chrome-remote-interface/lib/devtools.js +71 -191
  34. data/lib/opal/cli_runners/node_modules/chrome-remote-interface/lib/external-request.js +26 -6
  35. data/lib/opal/cli_runners/node_modules/chrome-remote-interface/lib/protocol.json +20788 -9049
  36. data/lib/opal/cli_runners/node_modules/chrome-remote-interface/lib/websocket-wrapper.js +10 -3
  37. data/lib/opal/cli_runners/node_modules/chrome-remote-interface/package.json +59 -123
  38. data/lib/opal/cli_runners/node_modules/chrome-remote-interface/webpack.config.js +25 -32
  39. data/lib/opal/cli_runners/node_modules/commander/History.md +298 -0
  40. data/lib/opal/cli_runners/node_modules/commander/LICENSE +22 -0
  41. data/lib/opal/cli_runners/node_modules/commander/Readme.md +217 -61
  42. data/lib/opal/cli_runners/node_modules/commander/index.js +431 -145
  43. data/lib/opal/cli_runners/node_modules/commander/package.json +16 -79
  44. data/lib/opal/cli_runners/node_modules/ws/README.md +334 -98
  45. data/lib/opal/cli_runners/node_modules/ws/browser.js +8 -0
  46. data/lib/opal/cli_runners/node_modules/ws/index.js +5 -10
  47. data/lib/opal/cli_runners/node_modules/ws/lib/buffer-util.js +129 -0
  48. data/lib/opal/cli_runners/node_modules/ws/lib/constants.js +10 -0
  49. data/lib/opal/cli_runners/node_modules/ws/lib/event-target.js +184 -0
  50. data/lib/opal/cli_runners/node_modules/ws/lib/extension.js +223 -0
  51. data/lib/opal/cli_runners/node_modules/ws/lib/limiter.js +55 -0
  52. data/lib/opal/cli_runners/node_modules/ws/lib/permessage-deflate.js +518 -0
  53. data/lib/opal/cli_runners/node_modules/ws/lib/receiver.js +607 -0
  54. data/lib/opal/cli_runners/node_modules/ws/lib/sender.js +409 -0
  55. data/lib/opal/cli_runners/node_modules/ws/lib/stream.js +180 -0
  56. data/lib/opal/cli_runners/node_modules/ws/lib/validation.js +104 -0
  57. data/lib/opal/cli_runners/node_modules/ws/lib/websocket-server.js +447 -0
  58. data/lib/opal/cli_runners/node_modules/ws/lib/websocket.js +1195 -0
  59. data/lib/opal/cli_runners/node_modules/ws/package.json +40 -106
  60. data/lib/opal/cli_runners/package-lock.json +62 -0
  61. data/lib/opal/cli_runners/package.json +1 -1
  62. data/lib/opal/cli_runners.rb +26 -4
  63. data/lib/opal/nodes/args/prepare_post_args.rb +2 -2
  64. data/lib/opal/nodes/def.rb +8 -8
  65. data/lib/opal/nodes/iter.rb +12 -12
  66. data/lib/opal/nodes/logic.rb +1 -1
  67. data/lib/opal/nodes/masgn.rb +2 -2
  68. data/lib/opal/parser/with_ruby_lexer.rb +1 -1
  69. data/lib/opal/paths.rb +14 -0
  70. data/lib/opal/rewriter.rb +2 -0
  71. data/lib/opal/rewriters/forward_args.rb +52 -4
  72. data/lib/opal/rewriters/targeted_patches.rb +94 -0
  73. data/lib/opal/version.rb +1 -1
  74. data/opal/corelib/basic_object.rb +1 -1
  75. data/opal/corelib/boolean.rb +2 -2
  76. data/opal/corelib/class.rb +11 -0
  77. data/opal/corelib/constants.rb +3 -3
  78. data/opal/corelib/enumerable.rb +4 -0
  79. data/opal/corelib/enumerator.rb +1 -1
  80. data/opal/corelib/hash.rb +2 -2
  81. data/opal/corelib/helpers.rb +1 -1
  82. data/opal/corelib/kernel.rb +3 -3
  83. data/opal/corelib/method.rb +1 -1
  84. data/opal/corelib/module.rb +29 -8
  85. data/opal/corelib/proc.rb +7 -5
  86. data/opal/corelib/runtime.js +141 -78
  87. data/opal/corelib/set.rb +252 -0
  88. data/opal/corelib/string.rb +2 -1
  89. data/opal/corelib/time.rb +2 -2
  90. data/opal/opal.rb +1 -0
  91. data/opal.gemspec +1 -0
  92. data/spec/filters/bugs/array.rb +22 -13
  93. data/spec/filters/bugs/base64.rb +5 -5
  94. data/spec/filters/bugs/basicobject.rb +16 -8
  95. data/spec/filters/bugs/bigdecimal.rb +161 -160
  96. data/spec/filters/bugs/binding.rb +10 -10
  97. data/spec/filters/bugs/class.rb +8 -8
  98. data/spec/filters/bugs/complex.rb +2 -1
  99. data/spec/filters/bugs/date.rb +79 -81
  100. data/spec/filters/bugs/datetime.rb +29 -29
  101. data/spec/filters/bugs/delegate.rb +1 -3
  102. data/spec/filters/bugs/encoding.rb +69 -69
  103. data/spec/filters/bugs/enumerable.rb +22 -20
  104. data/spec/filters/bugs/enumerator.rb +88 -85
  105. data/spec/filters/bugs/exception.rb +46 -40
  106. data/spec/filters/bugs/file.rb +32 -32
  107. data/spec/filters/bugs/float.rb +26 -21
  108. data/spec/filters/bugs/freeze.rb +88 -0
  109. data/spec/filters/bugs/hash.rb +39 -38
  110. data/spec/filters/bugs/integer.rb +57 -44
  111. data/spec/filters/bugs/io.rb +1 -1
  112. data/spec/filters/bugs/kernel.rb +349 -269
  113. data/spec/filters/bugs/language.rb +220 -188
  114. data/spec/filters/bugs/main.rb +5 -3
  115. data/spec/filters/bugs/marshal.rb +38 -38
  116. data/spec/filters/bugs/math.rb +2 -1
  117. data/spec/filters/bugs/method.rb +73 -62
  118. data/spec/filters/bugs/module.rb +163 -143
  119. data/spec/filters/bugs/numeric.rb +6 -6
  120. data/spec/filters/bugs/objectspace.rb +16 -16
  121. data/spec/filters/bugs/openstruct.rb +1 -1
  122. data/spec/filters/bugs/pack_unpack.rb +51 -51
  123. data/spec/filters/bugs/pathname.rb +7 -7
  124. data/spec/filters/bugs/proc.rb +63 -63
  125. data/spec/filters/bugs/random.rb +7 -6
  126. data/spec/filters/bugs/range.rb +12 -9
  127. data/spec/filters/bugs/rational.rb +8 -7
  128. data/spec/filters/bugs/regexp.rb +49 -48
  129. data/spec/filters/bugs/ruby-32.rb +56 -0
  130. data/spec/filters/bugs/set.rb +30 -30
  131. data/spec/filters/bugs/singleton.rb +4 -4
  132. data/spec/filters/bugs/string.rb +187 -99
  133. data/spec/filters/bugs/stringio.rb +7 -0
  134. data/spec/filters/bugs/stringscanner.rb +68 -68
  135. data/spec/filters/bugs/struct.rb +11 -9
  136. data/spec/filters/bugs/symbol.rb +1 -1
  137. data/spec/filters/bugs/time.rb +78 -63
  138. data/spec/filters/bugs/trace_point.rb +4 -4
  139. data/spec/filters/bugs/unboundmethod.rb +32 -17
  140. data/spec/filters/bugs/warnings.rb +8 -12
  141. data/spec/filters/unsupported/array.rb +24 -107
  142. data/spec/filters/unsupported/basicobject.rb +12 -12
  143. data/spec/filters/unsupported/bignum.rb +27 -52
  144. data/spec/filters/unsupported/class.rb +1 -2
  145. data/spec/filters/unsupported/delegator.rb +3 -3
  146. data/spec/filters/unsupported/enumerable.rb +2 -9
  147. data/spec/filters/unsupported/enumerator.rb +2 -11
  148. data/spec/filters/unsupported/file.rb +1 -1
  149. data/spec/filters/unsupported/float.rb +28 -47
  150. data/spec/filters/unsupported/hash.rb +8 -14
  151. data/spec/filters/unsupported/integer.rb +75 -91
  152. data/spec/filters/unsupported/kernel.rb +17 -35
  153. data/spec/filters/unsupported/language.rb +11 -19
  154. data/spec/filters/unsupported/marshal.rb +22 -41
  155. data/spec/filters/unsupported/matchdata.rb +28 -52
  156. data/spec/filters/unsupported/math.rb +1 -1
  157. data/spec/filters/unsupported/privacy.rb +229 -285
  158. data/spec/filters/unsupported/range.rb +1 -5
  159. data/spec/filters/unsupported/regexp.rb +40 -66
  160. data/spec/filters/unsupported/set.rb +2 -2
  161. data/spec/filters/unsupported/singleton.rb +4 -4
  162. data/spec/filters/unsupported/string.rb +305 -508
  163. data/spec/filters/unsupported/struct.rb +3 -4
  164. data/spec/filters/unsupported/symbol.rb +15 -18
  165. data/spec/filters/unsupported/thread.rb +1 -7
  166. data/spec/filters/unsupported/time.rb +159 -202
  167. data/spec/filters/unsupported/usage_of_files.rb +170 -259
  168. data/spec/lib/builder_spec.rb +4 -4
  169. data/spec/lib/rewriters/forward_args_spec.rb +32 -12
  170. data/spec/mspec-opal/runner.rb +2 -0
  171. data/spec/ruby_specs +4 -0
  172. data/stdlib/deno/base.rb +28 -0
  173. data/stdlib/deno/file.rb +340 -0
  174. data/stdlib/{headless_chrome.rb → headless_browser/base.rb} +1 -1
  175. data/stdlib/headless_browser/file.rb +15 -0
  176. data/stdlib/headless_browser.rb +4 -0
  177. data/stdlib/native.rb +1 -1
  178. data/stdlib/nodejs/file.rb +5 -0
  179. data/stdlib/opal/platform.rb +8 -6
  180. data/stdlib/opal-platform.rb +14 -8
  181. data/stdlib/set.rb +1 -258
  182. data/tasks/benchmarking.rake +62 -19
  183. data/tasks/performance.rake +1 -1
  184. data/tasks/testing.rake +5 -3
  185. data/test/nodejs/test_file.rb +29 -10
  186. data/test/opal/http_server.rb +28 -11
  187. data/test/opal/unsupported_and_bugs.rb +2 -1
  188. metadata +89 -50
  189. data/lib/opal/cli_runners/node_modules/ultron/LICENSE +0 -22
  190. data/lib/opal/cli_runners/node_modules/ultron/index.js +0 -138
  191. data/lib/opal/cli_runners/node_modules/ultron/package.json +0 -112
  192. data/lib/opal/cli_runners/node_modules/ws/SECURITY.md +0 -33
  193. data/lib/opal/cli_runners/node_modules/ws/lib/BufferUtil.fallback.js +0 -56
  194. data/lib/opal/cli_runners/node_modules/ws/lib/BufferUtil.js +0 -15
  195. data/lib/opal/cli_runners/node_modules/ws/lib/ErrorCodes.js +0 -28
  196. data/lib/opal/cli_runners/node_modules/ws/lib/EventTarget.js +0 -158
  197. data/lib/opal/cli_runners/node_modules/ws/lib/Extensions.js +0 -69
  198. data/lib/opal/cli_runners/node_modules/ws/lib/PerMessageDeflate.js +0 -339
  199. data/lib/opal/cli_runners/node_modules/ws/lib/Receiver.js +0 -520
  200. data/lib/opal/cli_runners/node_modules/ws/lib/Sender.js +0 -438
  201. data/lib/opal/cli_runners/node_modules/ws/lib/Validation.fallback.js +0 -9
  202. data/lib/opal/cli_runners/node_modules/ws/lib/Validation.js +0 -17
  203. data/lib/opal/cli_runners/node_modules/ws/lib/WebSocket.js +0 -705
  204. data/lib/opal/cli_runners/node_modules/ws/lib/WebSocketServer.js +0 -336
  205. data/spec/filters/bugs/boolean.rb +0 -3
  206. data/spec/filters/bugs/matrix.rb +0 -3
  207. data/spec/filters/unsupported/fixnum.rb +0 -15
  208. data/spec/filters/unsupported/freeze.rb +0 -102
  209. data/spec/filters/unsupported/pathname.rb +0 -4
  210. data/spec/filters/unsupported/proc.rb +0 -4
  211. data/spec/filters/unsupported/random.rb +0 -5
  212. data/spec/filters/unsupported/taint.rb +0 -162
@@ -1,14 +1,14 @@
1
1
  # NOTE: run bin/format-filters after changing this file
2
2
  opal_filter "Range" do
3
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
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
4
+ fails "Range#bsearch with Float values with a block returning negative, zero, positive numbers returns a boundary element if appropriate" # Expected nil == 2.9999999999999996 to be truthy but was false
5
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
6
6
  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" # TypeError: can't iterate from Float
7
7
  fails "Range#bsearch with Float values with a block returning negative, zero, positive numbers returns nil if the block never returns zero" # TypeError: can't iterate from Float
8
8
  fails "Range#bsearch with Float values with a block returning negative, zero, positive numbers returns nil if the block returns greater than zero for every element" # TypeError: can't iterate from Float
9
9
  fails "Range#bsearch with Float values with a block returning negative, zero, positive numbers returns nil if the block returns less than zero for every element" # TypeError: can't iterate from Float
10
10
  fails "Range#bsearch with Float values with a block returning negative, zero, positive numbers works with infinity bounds" # NotImplementedError: Can't #bsearch an infinite range
11
- fails "Range#bsearch with Float values with a block returning true or false returns a boundary element if appropriate" # NoMethodError: undefined method `prev_float' for 3
11
+ fails "Range#bsearch with Float values with a block returning true or false returns a boundary element if appropriate" # Expected nil == 2.9999999999999996 to be truthy but was false
12
12
  fails "Range#bsearch with Float values with a block returning true or false returns minimum element if the block returns true for every element" # TypeError: can't iterate from Float
13
13
  fails "Range#bsearch with Float values with a block returning true or false returns nil if the block returns false for every element" # TypeError: can't iterate from Float
14
14
  fails "Range#bsearch with Float values with a block returning true or false returns nil if the block returns nil for every element" # TypeError: can't iterate from Float
@@ -20,11 +20,11 @@ opal_filter "Range" do
20
20
  fails "Range#bsearch with beginless ranges and Float values with a block returning negative, zero, positive numbers returns nil if the block never returns zero" # NotImplementedError: Can't #bsearch an infinite range
21
21
  fails "Range#bsearch with beginless ranges and Float values with a block returning negative, zero, positive numbers returns nil if the block returns greater than zero for every element" # NotImplementedError: Can't #bsearch an infinite range
22
22
  fails "Range#bsearch with beginless ranges and Float values with a block returning negative, zero, positive numbers returns nil if the block returns less than zero for every element" # NotImplementedError: Can't #bsearch an infinite range
23
- fails "Range#bsearch with beginless ranges and Float values with a block returning negative, zero, positive numbers works with infinity bounds" # NoMethodError: undefined method `inf' for #<MSpecEnv:0x1b536>
23
+ fails "Range#bsearch with beginless ranges and Float values with a block returning negative, zero, positive numbers works with infinity bounds" # NotImplementedError: Can't #bsearch an infinite range
24
24
  fails "Range#bsearch with beginless ranges and Float values with a block returning true or false returns nil if the block returns nil for every element" # NotImplementedError: Can't #bsearch an infinite range
25
25
  fails "Range#bsearch with beginless ranges and Float values with a block returning true or false returns nil if the block returns true for every element" # NotImplementedError: Can't #bsearch an infinite range
26
26
  fails "Range#bsearch with beginless ranges and Float values with a block returning true or false returns the smallest element for which block returns true" # NotImplementedError: Can't #bsearch an infinite range
27
- fails "Range#bsearch with beginless ranges and Float values with a block returning true or false works with infinity bounds" # NoMethodError: undefined method `inf' for #<MSpecEnv:0x1b536>
27
+ fails "Range#bsearch with beginless ranges and Float values with a block returning true or false works with infinity bounds" # NotImplementedError: Can't #bsearch an infinite range
28
28
  fails "Range#bsearch with beginless ranges and Integer values with a block returning negative, zero, positive numbers accepts Float::INFINITY from the block" # NotImplementedError: Can't #bsearch an infinite range
29
29
  fails "Range#bsearch with beginless ranges and Integer values with a block returning negative, zero, positive numbers returns an element at an index for which block returns 0" # NotImplementedError: Can't #bsearch an infinite range
30
30
  fails "Range#bsearch with beginless ranges and Integer values with a block returning negative, zero, positive numbers returns an element at an index for which block returns 0.0" # NotImplementedError: Can't #bsearch an infinite range
@@ -37,12 +37,12 @@ opal_filter "Range" do
37
37
  fails "Range#bsearch with endless ranges and Float values with a block returning negative, zero, positive numbers returns nil if the block never returns zero" # NotImplementedError: Can't #bsearch an infinite range
38
38
  fails "Range#bsearch with endless ranges and Float values with a block returning negative, zero, positive numbers returns nil if the block returns greater than zero for every element" # NotImplementedError: Can't #bsearch an infinite range
39
39
  fails "Range#bsearch with endless ranges and Float values with a block returning negative, zero, positive numbers returns nil if the block returns less than zero for every element" # NotImplementedError: Can't #bsearch an infinite range
40
- fails "Range#bsearch with endless ranges and Float values with a block returning negative, zero, positive numbers works with infinity bounds" # NoMethodError: undefined method `inf' for #<MSpecEnv:0x1b536>
40
+ fails "Range#bsearch with endless ranges and Float values with a block returning negative, zero, positive numbers works with infinity bounds" # NotImplementedError: Can't #bsearch an infinite range
41
41
  fails "Range#bsearch with endless ranges and Float values with a block returning true or false returns minimum element if the block returns true for every element" # NotImplementedError: Can't #bsearch an infinite range
42
42
  fails "Range#bsearch with endless ranges and Float values with a block returning true or false returns nil if the block returns false for every element" # NotImplementedError: Can't #bsearch an infinite range
43
43
  fails "Range#bsearch with endless ranges and Float values with a block returning true or false returns nil if the block returns nil for every element" # NotImplementedError: Can't #bsearch an infinite range
44
44
  fails "Range#bsearch with endless ranges and Float values with a block returning true or false returns the smallest element for which block returns true" # NotImplementedError: Can't #bsearch an infinite range
45
- fails "Range#bsearch with endless ranges and Float values with a block returning true or false works with infinity bounds" # NoMethodError: undefined method `inf' for #<MSpecEnv:0x1b536>
45
+ fails "Range#bsearch with endless ranges and Float values with a block returning true or false works with infinity bounds" # NotImplementedError: Can't #bsearch an infinite range
46
46
  fails "Range#bsearch with endless ranges and Integer values with a block returning negative, zero, positive numbers accepts -Float::INFINITY from the block" # NotImplementedError: Can't #bsearch an infinite range
47
47
  fails "Range#bsearch with endless ranges and Integer values with a block returning negative, zero, positive numbers returns an element at an index for which block returns 0" # NotImplementedError: Can't #bsearch an infinite range
48
48
  fails "Range#bsearch with endless ranges and Integer values with a block returning negative, zero, positive numbers returns an element at an index for which block returns 0.0" # NotImplementedError: Can't #bsearch an infinite range
@@ -59,6 +59,8 @@ opal_filter "Range" do
59
59
  fails "Range#cover? range argument supports boundaries of different comparable types" # Expected false to be true
60
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
61
61
  fails "Range#first raises a TypeError if #to_int does not return an Integer" # Expected TypeError but no exception was raised ([2] was returned)
62
+ fails "Range#frozen? is true for Range.new" # Expected 1..2.frozen? to be truthy but was false
63
+ fails "Range#frozen? is true for literal ranges" # Expected 1..2.frozen? to be truthy but was false
62
64
  fails "Range#hash generates an Integer for the hash value" # Expected "A,1,1,0" (String) to be an instance of Integer
63
65
  fails "Range#include? on string elements returns false if other is not matched by element.succ" # Expected true to be false
64
66
  fails "Range#include? with weird succ when excluded end value returns false if other is not matched by element.succ" # Expected true to be false
@@ -69,7 +71,7 @@ opal_filter "Range" do
69
71
  fails "Range#last raises a TypeError if #to_int does not return an Integer" # Expected TypeError but no exception was raised ([3] was returned)
70
72
  fails "Range#max given a block calls #> and #< on the return value of the block" # Mock 'obj' expected to receive >("any_args") exactly 2 times but received it 0 times
71
73
  fails "Range#max given a block raises RangeError when called with custom comparison method on an beginless range" # Expected RangeError but got: TypeError (can't iterate from NilClass)
72
- fails "Range#max raises TypeError when called on a Time...Time(excluded end point)" # Expected TypeError but no exception was raised (1609624185562 was returned)
74
+ fails "Range#max raises TypeError when called on a Time...Time(excluded end point)" # Expected TypeError but no exception was raised (1670387451200 was returned)
73
75
  fails "Range#max raises TypeError when called on an exclusive range and a non Integer value" # Expected TypeError but no exception was raised (907.1111 was returned)
74
76
  fails "Range#max raises for an exclusive beginless range" # Expected TypeError (cannot exclude end value with non Integer begin value) but no exception was raised (0 was returned)
75
77
  fails "Range#max returns the maximum value in the range when called with no arguments" # Expected NaN == "e" to be truthy but was false
@@ -86,8 +88,8 @@ opal_filter "Range" do
86
88
  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
87
89
  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
88
90
  fails "Range#size returns nil for endless ranges if the start is not numeric" # Expected Infinity == nil to be truthy but was false
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)
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)
91
+ 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 (((1..2).step(#<MockObject:0x61a92>)) was returned)
92
+ 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 got: ArgumentError (no implicit conversion of MockObject into Integer)
91
93
  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
92
94
  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]
93
95
  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]
@@ -98,6 +100,7 @@ opal_filter "Range" do
98
100
  fails "Range#to_a works with Ranges of 64-bit integers" # Expected [256, 257] == [1099511627776, 1099511627777] to be truthy but was false
99
101
  fails "Range#to_s can show beginless ranges" # Expected "...1" == "...1.0" to be truthy but was false
100
102
  fails "Range#to_s can show endless ranges" # Expected "1..." == "1.0..." to be truthy but was false
103
+ fails "Range.new beginless/endless range creates a frozen range if the class is Range.class" # Expected 1..2.frozen? to be truthy but was false
101
104
  fails_badly "Range#min given a block raises RangeError when called with custom comparison method on an endless range" # Expected RangeError but got: Opal::SyntaxError (undefined method `type' for nil)
102
105
  fails_badly "Range#minmax on an exclusive range should return the minimum and maximum values for a numeric range without iterating the range"
103
106
  fails_badly "Range#step with an endless range and String values raises a TypeError when passed a Float step" # Expected TypeError but got: Opal::SyntaxError (undefined method `type' for nil)
@@ -1,13 +1,14 @@
1
1
  # NOTE: run bin/format-filters after changing this file
2
2
  opal_filter "Rational" do
3
- fails "Rational does not respond to new" # Expected NoMethodError but got: ArgumentError ([Rational#initialize] wrong number of arguments(1 for 2))
3
+ fails "Rational does not respond to new" # Expected NoMethodError but got: ArgumentError ([Rational#initialize] wrong number of arguments (given 1, expected 2))
4
4
  fails "Rational#coerce coerces to Rational, when given a Complex" # Expected nil == [(5/1), (3/4)] to be truthy but was false
5
5
  fails "Rational#coerce raises an error when passed a BigDecimal" # Expected TypeError (/BigDecimal can't be coerced into Rational/) but no exception was raised (nil was returned)
6
- fails "Rational#marshal_dump dumps numerator and denominator"
7
- fails "Rational#round with half option raise for a non-existent round mode" # TypeError: not an Integer
8
- fails "Rational#round with half option returns a Rational when the precision is greater than 0" # ArgumentError: [Rational#round] wrong number of arguments(2 for -1)
6
+ fails "Rational#marshal_dump dumps numerator and denominator" # NoMethodError: undefined method `marshal_dump' for (1/2)
7
+ fails "Rational#round with half option raise for a non-existent round mode" # Expected ArgumentError (invalid rounding mode: nonsense) but got: TypeError (not an Integer)
8
+ fails "Rational#round with half option returns a Rational when the precision is greater than 0" # ArgumentError: [Rational#round] wrong number of arguments (given 2, expected -1)
9
9
  fails "Rational#round with half option returns an Integer when precision is not passed" # TypeError: not an Integer
10
- fails "Rational#to_r fails when a BasicObject's to_r does not return a Rational" # NoMethodError: undefined method `nil?' for BasicObject
11
- fails "Rational#to_r raises TypeError trying to convert BasicObject" # NoMethodError: undefined method `nil?' for BasicObject
12
- fails "Rational#to_r works when a BasicObject has to_r" # NoMethodError: undefined method `nil?' for BasicObject
10
+ fails "Rational#to_f converts to a Float for large numerator and denominator" # Exception: Maximum call stack size exceeded
11
+ fails "Rational#to_r fails when a BasicObject's to_r does not return a Rational" # Expected TypeError but got: NoMethodError (undefined method `nil?' for #<BasicObject:0x182c8>)
12
+ fails "Rational#to_r raises TypeError trying to convert BasicObject" # Expected TypeError but got: NoMethodError (undefined method `nil?' for #<BasicObject:0x182d0>)
13
+ fails "Rational#to_r works when a BasicObject has to_r" # NoMethodError: undefined method `nil?' for #<BasicObject:0x182d8>
13
14
  end
@@ -2,50 +2,49 @@
2
2
  opal_filter "regular_expressions" do
3
3
  fails "MatchData#regexp returns a Regexp for the result of gsub(String)" # Expected /\[/gm == /\[/ to be truthy but was false
4
4
  fails "MatchData#string returns a frozen copy of the matched string for gsub(String)" # NotImplementedError: String#gsub! not supported. Mutable String methods are not supported in Opal.
5
- fails "MatchData.allocate is undefined" # Expected NoMethodError but no exception was raised (#<MatchData>(#pretty_inspect raised #<NoMethodError: undefined method `named_captures' for nil>) was returned)
5
+ fails "MatchData.allocate is undefined" # Expected NoMethodError but no exception was raised (#<MatchData>(#pretty_inspect raised #<NoMethodError: undefined method `named_captures' for nil>) was returned)
6
6
  fails "Regexp#encoding allows otherwise invalid characters if NOENCODING is specified" # NameError: uninitialized constant Regexp::NOENCODING
7
- fails "Regexp#encoding defaults to US-ASCII if the Regexp contains only US-ASCII character"
8
- fails "Regexp#encoding defaults to UTF-8 if \\u escapes appear"
9
- fails "Regexp#encoding defaults to UTF-8 if a literal UTF-8 character appears"
10
- fails "Regexp#encoding ignores the default_internal encoding"
11
- fails "Regexp#encoding ignores the encoding and uses US-ASCII if the string has only ASCII characters"
7
+ fails "Regexp#encoding defaults to US-ASCII if the Regexp contains only US-ASCII character" # NoMethodError: undefined method `encoding' for /ASCII/
8
+ fails "Regexp#encoding defaults to UTF-8 if \\u escapes appear" # NoMethodError: undefined method `encoding' for /\u{9879}/
9
+ fails "Regexp#encoding defaults to UTF-8 if a literal UTF-8 character appears" # NoMethodError: undefined method `encoding' for /¥/
10
+ fails "Regexp#encoding ignores the default_internal encoding" # NoMethodError: undefined method `default_internal' for Encoding
11
+ fails "Regexp#encoding ignores the encoding and uses US-ASCII if the string has only ASCII characters" # ArgumentError: unknown encoding name - euc-jp
12
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/
13
- fails "Regexp#encoding returns EUC_JP if the 'e' modifier is supplied"
14
- fails "Regexp#encoding returns US_ASCII if the 'n' modifier is supplied and only US-ASCII characters are present"
15
- fails "Regexp#encoding returns UTF-8 if the 'u' modifier is supplied"
16
- fails "Regexp#encoding returns Windows-31J if the 's' modifier is supplied"
17
- fails "Regexp#encoding returns an Encoding object"
18
- fails "Regexp#encoding upgrades the encoding to that of an embedded String"
19
- fails "Regexp#fixed_encoding? returns false by default"
20
- fails "Regexp#fixed_encoding? returns false if the 'n' modifier was supplied to the Regexp"
21
- fails "Regexp#fixed_encoding? returns true if the 'e' modifier was supplied to the Regexp"
22
- fails "Regexp#fixed_encoding? returns true if the 's' modifier was supplied to the Regexp"
23
- fails "Regexp#fixed_encoding? returns true if the 'u' modifier was supplied to the Regexp"
24
- fails "Regexp#fixed_encoding? returns true if the Regexp contains a UTF-8 literal"
25
- fails "Regexp#fixed_encoding? returns true if the Regexp contains a \\u escape"
26
- fails "Regexp#fixed_encoding? returns true if the Regexp was created with the Regexp::FIXEDENCODING option"
27
- fails "Regexp#hash is based on the text and options of Regexp"
28
- fails "Regexp#hash returns the same value for two Regexps differing only in the /n option"
29
- fails "Regexp#initialize raises a TypeError on an initialized non-literal Regexp"
30
- fails "Regexp#inspect does not include a character set code"
31
- fails "Regexp#inspect does not include the 'o' option"
32
- fails "Regexp#inspect returns options in the order 'mixn'"
33
- fails "Regexp#named_captures works with duplicate capture group names"
34
- fails "Regexp#names returns each capture name only once"
35
- fails "Regexp#source will remove escape characters" # Expected "foo\\/bar" to equal "foo/bar"
36
- fails "Regexp#to_s deals properly with the two types of lookahead groups"
37
- fails "Regexp#to_s returns a string in (?xxx:yyy) notation"
38
- fails "Regexp#to_s shows all options as excluded if none are selected"
39
- fails "Regexp#to_s shows non-included options after a - sign"
40
- fails "Regexp#to_s shows the pattern after the options"
13
+ fails "Regexp#encoding returns EUC_JP if the 'e' modifier is supplied" # NoMethodError: undefined method `encoding' for /ASCII/
14
+ fails "Regexp#encoding returns US_ASCII if the 'n' modifier is supplied and only US-ASCII characters are present" # NoMethodError: undefined method `encoding' for /ASCII/
15
+ fails "Regexp#encoding returns UTF-8 if the 'u' modifier is supplied" # NoMethodError: undefined method `encoding' for /ASCII/u
16
+ fails "Regexp#encoding returns Windows-31J if the 's' modifier is supplied" # NoMethodError: undefined method `encoding' for /ASCII/
17
+ fails "Regexp#encoding returns an Encoding object" # NoMethodError: undefined method `encoding' for /glar/
18
+ fails "Regexp#encoding upgrades the encoding to that of an embedded String" # ArgumentError: unknown encoding name - euc-jp
19
+ fails "Regexp#fixed_encoding? returns false by default" # NoMethodError: undefined method `fixed_encoding?' for /needle/
20
+ fails "Regexp#fixed_encoding? returns false if the 'n' modifier was supplied to the Regexp" # NoMethodError: undefined method `fixed_encoding?' for /needle/
21
+ fails "Regexp#fixed_encoding? returns true if the 'e' modifier was supplied to the Regexp" # NoMethodError: undefined method `fixed_encoding?' for /needle/
22
+ fails "Regexp#fixed_encoding? returns true if the 's' modifier was supplied to the Regexp" # NoMethodError: undefined method `fixed_encoding?' for /needle/
23
+ fails "Regexp#fixed_encoding? returns true if the 'u' modifier was supplied to the Regexp" # NoMethodError: undefined method `fixed_encoding?' for /needle/u
24
+ fails "Regexp#fixed_encoding? returns true if the Regexp contains a UTF-8 literal" # NoMethodError: undefined method `fixed_encoding?' for /文字化け/
25
+ fails "Regexp#fixed_encoding? returns true if the Regexp contains a \\u escape" # NoMethodError: undefined method `fixed_encoding?' for /needle \u{8768}/
26
+ fails "Regexp#fixed_encoding? returns true if the Regexp was created with the Regexp::FIXEDENCODING option" # NameError: uninitialized constant Regexp::FIXEDENCODING
27
+ fails "Regexp#hash is based on the text and options of Regexp" # Expected false == true to be truthy but was false
28
+ fails "Regexp#hash returns the same value for two Regexps differing only in the /n option" # Expected false == true to be truthy but was false
29
+ fails "Regexp#initialize raises a TypeError on an initialized non-literal Regexp" # Expected TypeError but no exception was raised (nil was returned)
30
+ fails "Regexp#inspect does not include a character set code" # Expected "/(?:)/" == "//" to be truthy but was false
31
+ fails "Regexp#inspect does not include the 'o' option" # Expected "/(?:)/" == "//" to be truthy but was false
32
+ fails "Regexp#inspect returns options in the order 'mixn'" # Expected "/(?:)/" == "//mixn" to be truthy but was false
33
+ fails "Regexp#named_captures works with duplicate capture group names" # Exception: Invalid regular expression: /this (?<is>is) [aA] (?<pat>pate?(?<is>rn))/: Duplicate capture group name
34
+ fails "Regexp#names returns each capture name only once" # Exception: Invalid regular expression: /n(?<cap>ee)d(?<cap>le)/: Duplicate capture group name
35
+ fails "Regexp#to_s deals properly with the two types of lookahead groups" # Expected "(?=5)" == "(?-mix:(?=5))" to be truthy but was false
36
+ fails "Regexp#to_s returns a string in (?xxx:yyy) notation" # Expected "(?:.)" == "(?-mix:.)" to be truthy but was false
37
+ fails "Regexp#to_s shows all options as excluded if none are selected" # Expected "abc" == "(?-mix:abc)" to be truthy but was false
38
+ fails "Regexp#to_s shows non-included options after a - sign" # Expected "abc" == "(?i-mx:abc)" to be truthy but was false
39
+ fails "Regexp#to_s shows the pattern after the options" # Expected "xyz" == "(?-mix:xyz)" to be truthy but was false
41
40
  fails "Regexp.compile given a Regexp does not honour options given as additional arguments" # Expected warning to match: /flags ignored/ but got: ""
42
41
  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
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)
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)
45
- fails "Regexp.compile given a String ignores the third argument if it is 'u' or 'utf8' (case-insensitive)" # ArgumentError: [Regexp.new] wrong number of arguments(3 for -2)
46
- fails "Regexp.compile given a String raises a RegexpError when passed an incorrect regexp" # Exception: Invalid regular expression: /^[$/: Unterminated character class
47
- fails "Regexp.compile given a String uses ASCII_8BIT encoding if third argument is 'n' or 'none' (case insensitive) and non-ascii characters" # ArgumentError: [Regexp.new] wrong number of arguments(3 for -2)
48
- fails "Regexp.compile given a String uses US_ASCII encoding if third argument is 'n' or 'none' (case insensitive) and only ascii characters" # ArgumentError: [Regexp.new] wrong number of arguments(3 for -2)
42
+ 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 (given 3, expected -2)
43
+ 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 (given 3, expected -2)
44
+ fails "Regexp.compile given a String ignores the third argument if it is 'u' or 'utf8' (case-insensitive)" # ArgumentError: [Regexp.new] wrong number of arguments (given 3, expected -2)
45
+ fails "Regexp.compile given a String raises a RegexpError when passed an incorrect regexp" # Expected RegexpError but got: Exception (Invalid regular expression: /^[$/: Unterminated character class)
46
+ fails "Regexp.compile given a String uses ASCII_8BIT encoding if third argument is 'n' or 'none' (case insensitive) and non-ascii characters" # ArgumentError: [Regexp.new] wrong number of arguments (given 3, expected -2)
47
+ fails "Regexp.compile given a String uses US_ASCII encoding if third argument is 'n' or 'none' (case insensitive) and only ascii characters" # ArgumentError: [Regexp.new] wrong number of arguments (given 3, expected -2)
49
48
  fails "Regexp.compile given a String with escaped characters raises a RegexpError if \\x is not followed by any hexadecimal digits" # Expected RegexpError but no exception was raised (/\xn/ was returned)
50
49
  fails "Regexp.compile given a String with escaped characters raises a RegexpError if less than four digits are given for \\uHHHH" # Expected RegexpError but no exception was raised (/\u304/ was returned)
51
50
  fails "Regexp.compile given a String with escaped characters raises a RegexpError if more than six hexadecimal digits are given" # Expected RegexpError but no exception was raised (/\u{0ffffff}/ was returned)
@@ -53,19 +52,21 @@ opal_filter "regular_expressions" do
53
52
  fails "Regexp.compile given a String with escaped characters returns a Regexp with US-ASCII encoding if UTF-8 escape sequences using only 7-bit ASCII are present" # NoMethodError: undefined method `encoding' for /a/
54
53
  fails "Regexp.compile given a String with escaped characters returns a Regexp with US-ASCII encoding if only 7-bit ASCII characters are present regardless of the input String's encoding" # NoMethodError: undefined method `encoding' for /abc/
55
54
  fails "Regexp.compile given a String with escaped characters returns a Regexp with UTF-8 encoding if any UTF-8 escape sequences outside 7-bit ASCII are present" # NoMethodError: undefined method `encoding' for /ÿ/
56
- fails "Regexp.compile given a String with escaped characters returns a Regexp with source String having US-ASCII encoding if UTF-8 escape sequences using only 7-bit ASCII are present" # Expected #<Encoding:UTF-16LE> to equal #<Encoding:ASCII-8BIT (dummy)>
57
- fails "Regexp.compile given a String with escaped characters returns a Regexp with source String having US-ASCII encoding if only 7-bit ASCII characters are present regardless of the input String's encoding" # Expected #<Encoding:UTF-16LE> to equal #<Encoding:ASCII-8BIT (dummy)>
55
+ fails "Regexp.compile given a String with escaped characters returns a Regexp with source String having US-ASCII encoding if UTF-8 escape sequences using only 7-bit ASCII are present" # Expected #<Encoding:UTF-8> == #<Encoding:US-ASCII> to be truthy but was false
56
+ fails "Regexp.compile given a String with escaped characters returns a Regexp with source String having US-ASCII encoding if only 7-bit ASCII characters are present regardless of the input String's encoding" # Expected #<Encoding:UTF-8> == #<Encoding:US-ASCII> to be truthy but was false
58
57
  fails "Regexp.compile given a String with escaped characters returns a Regexp with source String having the input String's encoding" # NameError: uninitialized constant Encoding::Shift_JIS
59
58
  fails "Regexp.compile given a String with escaped characters returns a Regexp with the input String's encoding" # NameError: uninitialized constant Encoding::Shift_JIS
60
59
  fails "Regexp.compile works by default for subclasses with overridden #initialize" # Expected /hi/ (Regexp) to be kind of RegexpSpecsSubclass
61
60
  fails "Regexp.escape sets the encoding of the result to BINARY if any non-US-ASCII characters are present in an input String with invalid encoding" # Expected true to be false
62
61
  fails "Regexp.new 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
63
- fails "Regexp.new given a String raises a RegexpError when passed an incorrect regexp"
64
- fails "Regexp.new given a String with escaped characters raises a RegexpError if \\x is not followed by any hexadecimal digits"
65
- fails "Regexp.new given a String with escaped characters raises a RegexpError if more than six hexadecimal digits are given"
66
- fails "Regexp.new works by default for subclasses with overridden #initialize"
62
+ fails "Regexp.new given a String raises a RegexpError when passed an incorrect regexp" # Expected RegexpError but got: Exception (Invalid regular expression: /^[$/: Unterminated character class)
63
+ fails "Regexp.new given a String with escaped characters raises a RegexpError if \\x is not followed by any hexadecimal digits" # Expected RegexpError but no exception was raised (/\xn/ was returned)
64
+ fails "Regexp.new given a String with escaped characters raises a RegexpError if more than six hexadecimal digits are given" # Expected RegexpError but no exception was raised (/\u{0ffffff}/ was returned)
65
+ fails "Regexp.new given a non-String/Regexp raises TypeError if #to_str returns non-String value" # Expected TypeError (/can't convert Object to String/) but got: TypeError (can't convert Object into String (Object#to_str gives Array))
66
+ fails "Regexp.new given a non-String/Regexp raises TypeError if there is no #to_str method for non-String/Regexp argument" # Expected TypeError (no implicit conversion of Integer into String) but got: TypeError (no implicit conversion of Number into String)
67
+ fails "Regexp.new works by default for subclasses with overridden #initialize" # Expected /hi/ (Regexp) to be kind of RegexpSpecsSubclass
67
68
  fails "Regexp.quote sets the encoding of the result to BINARY if any non-US-ASCII characters are present in an input String with invalid encoding" # Expected true to be false
68
- fails "Regexp.try_convert returns nil if given an argument that can't be converted to a Regexp"
69
- fails "Regexp.try_convert tries to coerce the argument by calling #to_regexp"
69
+ fails "Regexp.try_convert returns nil if given an argument that can't be converted to a Regexp" # NoMethodError: undefined method `try_convert' for Regexp
70
+ fails "Regexp.try_convert tries to coerce the argument by calling #to_regexp" # Mock 'regexp' expected to receive to_regexp("any_args") exactly 1 times but received it 0 times
70
71
  fails "Regexp.union uses to_regexp to convert argument" # Mock 'pattern' expected to receive to_regexp("any_args") exactly 1 times but received it 0 times
71
72
  end
@@ -0,0 +1,56 @@
1
+ # NOTE: run bin/format-filters after changing this file
2
+ opal_filter "Ruby 3.2" do
3
+ fails "A block yielded a single Array does not autosplat single argument to required arguments when a keyword rest argument is present" # ArgumentError: expected kwargs
4
+ fails "Data is a new constant" # NameError: uninitialized constant Data
5
+ fails "Data is not deprecated" # NameError: uninitialized constant Data
6
+ fails "Fixnum is no longer defined" # Expected Object.const_defined? "Fixnum" to be falsy but was true
7
+ fails "Kernel#=~ is no longer defined" # Expected #<Object:0x11214>.respond_to? "=~" to be falsy but was true
8
+ fails "Kernel#sprintf other formats c displays no characters if argument is an empty string" # ArgumentError: %c requires a character
9
+ fails "Kernel#sprintf other formats c displays only the first character if argument is a string of several characters" # ArgumentError: %c requires a character
10
+ fails "Kernel.printf formatting io is not specified other formats c displays no characters if argument is an empty string" # ArgumentError: %c requires a character
11
+ fails "Kernel.printf formatting io is not specified other formats c displays only the first character if argument is a string of several characters" # ArgumentError: %c requires a character
12
+ fails "Kernel.printf formatting io is specified other formats c displays no characters if argument is an empty string" # Exception: format_string.indexOf is not a function
13
+ fails "Kernel.printf formatting io is specified other formats c displays only the first character if argument is a string of several characters" # Exception: format_string.indexOf is not a function
14
+ fails "Kernel.sprintf other formats c displays no characters if argument is an empty string" # ArgumentError: %c requires a character
15
+ fails "Kernel.sprintf other formats c displays only the first character if argument is a string of several characters" # ArgumentError: %c requires a character
16
+ fails "Keyword arguments delegation does not work with call(*ruby2_keyword_args) with missing ruby2_keywords in between" # Expected [[], {}] == [[{}], {}] to be truthy but was false
17
+ fails "Method#owner returns the class on which public was called for a private method in ancestor" # Expected MethodSpecs::InheritedMethods::B == MethodSpecs::InheritedMethods::C to be truthy but was false
18
+ fails "Method#parameters adds * rest arg for \"star\" argument" # Expected [["rest"]] == [["rest", "*"]] to be truthy but was false
19
+ fails "Module#const_added is a private instance method" # Expected Module to have private instance method 'const_added' but it does not
20
+ fails "Module#const_added is called with a precise caller location with the line of definition" # Expected [] == [111, 113, 116, 120] to be truthy but was false
21
+ fails "Module#ruby2_keywords makes a copy and unmark the Hash when calling a method taking (*args)" # Expected false == true to be truthy but was false
22
+ fails "Proc#parameters adds * rest arg for \"star\" argument" # Expected [["req", "x"], ["rest"]] == [["req", "x"], ["rest", "*"]] to be truthy but was false
23
+ fails "Random::DEFAULT is no longer defined" # Expected Random.const_defined? "DEFAULT" to be falsy but was true
24
+ fails "Range#size returns nil for all beginless ranges if the start is numeric" # Expected Infinity == nil to be truthy but was false
25
+ fails "Range#size returns nil if the start and the end is both nil" # Expected Infinity == nil to be truthy but was false
26
+ fails "Refinement#append_features is not called by Module#include" # Expected TypeError but no exception was raised (#<Class:0x2e61c> was returned)
27
+ fails "Refinement#extend_object is not called by Object#extend" # Expected TypeError but no exception was raised (#<Class:0x28fcc> was returned)
28
+ fails "Refinement#prepend_features is not called by Module#prepend" # Expected TypeError but no exception was raised (#<Class:0x70cf6> was returned)
29
+ fails "Regexp.compile given a String accepts a String of supported flags as the second argument" # Expected 0 == 0 to be falsy but was true
30
+ fails "Regexp.compile given a String raises an Argument error if the second argument contains unsupported chars" # Expected ArgumentError but no exception was raised (/Hi/i was returned)
31
+ fails "Regexp.compile given a String warns any non-Integer, non-nil, non-false second argument" # Expected warning to match: /expected true or false as ignorecase/ but got: ""
32
+ fails "Regexp.new given a String accepts a String of supported flags as the second argument" # Expected 0 == 0 to be falsy but was true
33
+ fails "Regexp.new given a String raises an Argument error if the second argument contains unsupported chars" # Expected ArgumentError but no exception was raised (/Hi/i was returned)
34
+ fails "Regexp.new given a String warns any non-Integer, non-nil, non-false second argument" # Expected warning to match: /expected true or false as ignorecase/ but got: ""
35
+ fails "Regexp.timeout raises Regexp::TimeoutError after global timeout elapsed" # NoMethodError: undefined method `timeout=' for Regexp
36
+ fails "Regexp.timeout raises Regexp::TimeoutError after timeout keyword value elapsed" # NoMethodError: undefined method `timeout=' for Regexp
37
+ fails "Regexp.timeout returns global timeout" # NoMethodError: undefined method `timeout=' for Regexp
38
+ fails "String#% other formats c displays no characters if argument is an empty string" # ArgumentError: %c requires a character
39
+ fails "String#% other formats c displays only the first character if argument is a string of several characters" # ArgumentError: %c requires a character
40
+ fails "String#% supports only the first character as argument for %c" # ArgumentError: %c requires a character
41
+ fails "String#dedup deduplicates frozen strings" # Expected "this string is frozen" not to be identical to "this string is frozen"
42
+ fails "String#dedup does not deduplicate a frozen string when it has instance variables" # Exception: Cannot create property 'a' on string 'this string is frozen'
43
+ fails "String#dedup interns the provided string if it is frozen" # NoMethodError: undefined method `dedup' for "this string is unique and frozen 0.698166086070234"
44
+ fails "String#dedup returns a frozen copy if the String is not frozen" # NoMethodError: undefined method `dedup' for "foo"
45
+ fails "String#dedup returns self if the String is frozen" # NoMethodError: undefined method `dedup' for "foo"
46
+ fails "String#dedup returns the same object for equal unfrozen strings" # Expected "this is a string" not to be identical to "this is a string"
47
+ fails "String#dedup returns the same object when it's called on the same String literal" # NoMethodError: undefined method `dedup' for "unfrozen string"
48
+ fails "StringIO#each when passed a separator yields each paragraph with all separation characters when passed an empty String as separator" # Expected ["para1\n" + "\n", "para2\n" + "\n", "para3"] == ["para1\n" + "\n", "para2\n" + "\n" + "\n", "para3"] to be truthy but was false
49
+ fails "StringIO#each_line when passed a separator yields each paragraph with all separation characters when passed an empty String as separator" # Expected ["para1\n" + "\n", "para2\n" + "\n", "para3"] == ["para1\n" + "\n", "para2\n" + "\n" + "\n", "para3"] to be truthy but was false
50
+ fails "Struct.new on subclasses accepts keyword arguments to initialize" # Expected #<struct args={"args"=>42}> == #<struct args=42> to be truthy but was false
51
+ fails "Struct.new raises a TypeError if passed a Hash with an unknown key" # Expected TypeError but no exception was raised (#<Class:0x356> was returned)
52
+ fails "Symbol#to_proc only calls public methods" # Expected NoMethodError (/protected method `pro' called/) but no exception was raised (#<MSpecEnv:0x146c8 @a=["pub", "pro"]> was returned)
53
+ fails "The module keyword does not reopen a module included in Object" # Expected ModuleSpecs::IncludedInObject::IncludedModuleSpecs == ModuleSpecs::IncludedInObject::IncludedModuleSpecs to be falsy but was true
54
+ fails "UnboundMethod#owner returns the class on which public was called for a private method in ancestor" # Expected MethodSpecs::InheritedMethods::B == MethodSpecs::InheritedMethods::C to be truthy but was false
55
+ fails "main.using does not raise error when wrapped with module" # Expected to not get Exception but got: ArgumentError ([MSpecEnv#load] wrong number of arguments (given 2, expected 1))
56
+ end
@@ -1,48 +1,48 @@
1
1
  # NOTE: run bin/format-filters after changing this file
2
2
  opal_filter "Set" do
3
- fails "Set#& raises an ArgumentError when passed a non-Enumerable"
4
- fails "Set#& returns a new Set containing only elements shared by self and the passed Enumerable"
3
+ fails "Set#& raises an ArgumentError when passed a non-Enumerable" # Expected ArgumentError but got: NoMethodError (undefined method `&' for #<Set: {a,b,c}>)
4
+ fails "Set#& returns a new Set containing only elements shared by self and the passed Enumerable" # NoMethodError: undefined method `&' for #<Set: {a,b,c}>
5
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
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
7
- fails "Set#== does not depend on the order of nested Sets"
8
- fails "Set#== returns true when the passed Object is a Set and self and the Object contain the same elements"
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)>
10
- fails "Set#=== member equality is checked using both #hash and #eql?" # Expected false to equal true
7
+ fails "Set#== does not depend on the order of nested Sets" # Expected #<Set: {#<Set:0xb8280>,#<Set:0xb8282>,#<Set:0xb8284>}> == #<Set: {#<Set:0xb828a>,#<Set:0xb828c>,#<Set:0xb828e>}> to be truthy but was false
8
+ fails "Set#== returns true when the passed Object is a Set and self and the Object contain the same elements" # Expected #<Set: {1,2,3}> == #<Set: {1,2,3}> to be falsy but was true
9
+ fails "Set#=== is an alias for include?" # Expected #<Method: Set#=== (defined in Kernel in <internal:corelib/kernel.rb>:13)> == #<Method: Set#include? (defined in Set in ./set.rb:161)> to be truthy but was false
10
+ fails "Set#=== member equality is checked using both #hash and #eql?" # Expected false == true to be truthy but was false
11
11
  fails "Set#=== returns true when self contains the passed Object" # Expected false to be true
12
- fails "Set#^ raises an ArgumentError when passed a non-Enumerable"
12
+ fails "Set#^ raises an ArgumentError when passed a non-Enumerable" # Expected ArgumentError but got: NoMethodError (undefined method `^' for #<Set: {1,2,3,4}>)
13
13
  fails "Set#^ returns a new Set containing elements that are not in both self and the passed Enumerable" # NoMethodError: undefined method `^' for #<Set: {1,2,3,4}>
14
14
  fails "Set#compare_by_identity compares its members by identity" # Expected ["a", "b"] == ["a", "b", "b"] to be truthy but was false
15
15
  fails "Set#compare_by_identity is not equal to set what does not compare by identity" # Expected #<Set: {1,2}> == #<Set: {1,2}> to be falsy but was true
16
16
  fails "Set#compare_by_identity regards #clone'd objects as having different identities" # Expected ["a"] == ["a", "a"] to be truthy but was false
17
17
  fails "Set#compare_by_identity regards #dup'd objects as having different identities" # Expected ["a"] == ["a", "a"] to be truthy but was false
18
- fails "Set#divide divides self into a set of subsets based on the blocks return values"
19
- fails "Set#divide when passed a block with an arity of 2 divides self into a set of subsets based on the blocks return values"
20
- fails "Set#divide when passed a block with an arity of 2 yields each two Object to the block"
21
- fails "Set#divide yields each Object to the block"
22
- fails "Set#flatten raises an ArgumentError when self is recursive"
23
- fails "Set#flatten returns a copy of self with each included Set flattened"
24
- fails "Set#flatten when Set contains a Set-like object returns a copy of self with each included Set-like object flattened" # NoMethodError: undefined method `flatten' for #<Set: {#<SetSpecs::SetLike:0x8b30c>}>
25
- fails "Set#flatten! flattens self"
26
- fails "Set#flatten! raises an ArgumentError when self is recursive"
27
- fails "Set#flatten! returns nil when self was not modified"
28
- fails "Set#flatten! returns self when self was modified"
29
- fails "Set#flatten! when Set contains a Set-like object flattens self, including Set-like objects" # NoMethodError: undefined method `flatten!' for #<Set: {#<SetSpecs::SetLike:0x8b318>}>
30
- fails "Set#flatten_merge flattens the passed Set and merges it into self"
31
- fails "Set#flatten_merge raises an ArgumentError when trying to flatten a recursive Set"
32
- fails "Set#hash is static"
18
+ fails "Set#divide divides self into a set of subsets based on the blocks return values" # NoMethodError: undefined method `divide' for #<Set: {one,two,three,four,five}>
19
+ fails "Set#divide when passed a block with an arity of 2 divides self into a set of subsets based on the blocks return values" # NoMethodError: undefined method `divide' for #<Set: {1,3,4,6,9,10,11}>
20
+ fails "Set#divide when passed a block with an arity of 2 yields each two Object to the block" # NoMethodError: undefined method `divide' for #<Set: {1,2}>
21
+ fails "Set#divide yields each Object to the block" # NoMethodError: undefined method `divide' for #<Set: {one,two,three,four,five}>
22
+ fails "Set#flatten raises an ArgumentError when self is recursive" # Expected ArgumentError but got: NoMethodError (undefined method `flatten' for #<Set: {#<Set:0xb7b90>}>)
23
+ fails "Set#flatten returns a copy of self with each included Set flattened" # NoMethodError: undefined method `flatten' for #<Set: {1,2,#<Set:0xb7b9c>,9,10}>
24
+ fails "Set#flatten when Set contains a Set-like object returns a copy of self with each included Set-like object flattened" # NoMethodError: undefined method `flatten' for #<Set: {#<SetSpecs::SetLike:0xb7ba2>}>
25
+ fails "Set#flatten! flattens self" # NoMethodError: undefined method `flatten!' for #<Set: {1,2,#<Set:0xb7bc8>,9,10}>
26
+ fails "Set#flatten! raises an ArgumentError when self is recursive" # Expected ArgumentError but got: NoMethodError (undefined method `flatten!' for #<Set: {#<Set:0xb7bb6>}>)
27
+ fails "Set#flatten! returns nil when self was not modified" # NoMethodError: undefined method `flatten!' for #<Set: {1,2,3,4}>
28
+ fails "Set#flatten! returns self when self was modified" # NoMethodError: undefined method `flatten!' for #<Set: {1,2,#<Set:0xb7bbe>}>
29
+ fails "Set#flatten! when Set contains a Set-like object flattens self, including Set-like objects" # NoMethodError: undefined method `flatten!' for #<Set: {#<SetSpecs::SetLike:0xb7bd2>}>
30
+ fails "Set#flatten_merge flattens the passed Set and merges it into self" # NoMethodError: undefined method `flatten_merge' for #<Set: {1,2}>
31
+ fails "Set#flatten_merge raises an ArgumentError when trying to flatten a recursive Set" # Expected ArgumentError but got: NoMethodError (undefined method `flatten_merge' for #<Set: {1,2,3}>)
32
+ fails "Set#hash is static" # Expected 752958 == 752962 to be truthy but was false
33
33
  fails "Set#initialize uses #each on the provided Enumerable if it does not respond to #each_entry" # ArgumentError: value must be enumerable
34
34
  fails "Set#initialize uses #each_entry on the provided Enumerable" # ArgumentError: value must be enumerable
35
- 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
36
- fails "Set#inspect correctly handles self-references"
37
- fails "Set#intersection raises an ArgumentError when passed a non-Enumerable"
38
- fails "Set#intersection returns a new Set containing only elements shared by self and the passed Enumerable"
35
+ fails "Set#initialize_clone does not freeze the new Set when called from clone(freeze: false)" # FrozenError: can't modify frozen Hash: {1=>true, 2=>true}
36
+ fails "Set#inspect correctly handles self-references" # Expected "#<Set: {#<Set:0xa64>}>" to include "#<Set: {...}>"
37
+ fails "Set#intersection raises an ArgumentError when passed a non-Enumerable" # Expected ArgumentError but got: NoMethodError (undefined method `intersection' for #<Set: {a,b,c}>)
38
+ fails "Set#intersection returns a new Set containing only elements shared by self and the passed Enumerable" # NoMethodError: undefined method `intersection' for #<Set: {a,b,c}>
39
39
  fails "Set#join calls #to_a to convert the Set in to an Array" # NoMethodError: undefined method `join' for #<Set: {a,b,c}>
40
40
  fails "Set#join does not separate elements when the passed separator is nil" # NoMethodError: undefined method `join' for #<Set: {a,b,c}>
41
41
  fails "Set#join returns a new string formed by joining elements after conversion" # NoMethodError: undefined method `join' for #<Set: {a,b,c}>
42
42
  fails "Set#join returns a string formed by concatenating each element separated by the separator" # NoMethodError: undefined method `join' for #<Set: {a,b,c}>
43
43
  fails "Set#join returns an empty string if the Set is empty" # NoMethodError: undefined method `join' for #<Set: {}>
44
- fails "Set#merge raises an ArgumentError when passed a non-Enumerable"
45
- fails "Set#pretty_print_cycle passes the 'pretty print' representation of a self-referencing Set to the pretty print writer"
46
- fails "Set#to_s correctly handles self-references" # Expected "#<Set:0x865de>" to include "#<Set: {...}>"
47
- 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)>
44
+ fails "Set#merge raises an ArgumentError when passed a non-Enumerable" # Expected ArgumentError but got: NoMethodError (undefined method `each' for 1)
45
+ fails "Set#pretty_print_cycle passes the 'pretty print' representation of a self-referencing Set to the pretty print writer" # Mock 'PrettyPrint' expected to receive text("#<Set: {...}>") exactly 1 times but received it 0 times
46
+ fails "Set#to_s correctly handles self-references" # Expected "#<Set:0x9d6>" to include "#<Set: {...}>"
47
+ fails "Set#to_s is an alias of inspect" # Expected #<Method: Set#to_s (defined in Kernel in <internal:corelib/kernel.rb>:768)> == #<Method: Set#inspect (defined in Set in ./set.rb:36)> to be truthy but was false
48
48
  end
@@ -1,7 +1,7 @@
1
1
  # NOTE: run bin/format-filters after changing this file
2
2
  opal_filter "Singleton" do
3
- fails "Singleton._load returns the singleton instance for anything passed in to subclass"
4
- fails "Singleton._load returns the singleton instance for anything passed in"
5
- fails "Singleton.instance returns an instance of the singleton's clone"
6
- fails "Singleton.instance returns the same instance for multiple class to instance on clones"
3
+ fails "Singleton._load returns the singleton instance for anything passed in to subclass" # NoMethodError: undefined method `_load' for SingletonSpecs::MyClassChild
4
+ fails "Singleton._load returns the singleton instance for anything passed in" # NoMethodError: undefined method `_load' for SingletonSpecs::MyClass
5
+ fails "Singleton.instance returns an instance of the singleton's clone" # Exception: self.$$constructor is not a constructor
6
+ fails "Singleton.instance returns the same instance for multiple class to instance on clones" # Exception: self.$$constructor is not a constructor
7
7
  end