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,20 +1,6 @@
1
1
  # NOTE: run bin/format-filters after changing this file
2
2
  opal_filter "Encoding" do
3
- fails "File.basename returns basename windows forward slash" # Expected "C:" to equal "/"
4
- fails "File.basename returns basename windows unc" # Expected "\\\\foo\\bar\\baz.txt" to equal "baz.txt"
5
- fails "File.basename returns basename with windows suffix" # Expected "c:\\bar" to equal "bar"
6
- fails "File.basename returns the basename for windows" # Expected "C:\\foo\\bar\\baz.txt" to equal "baz.txt"
7
3
  fails "File.basename returns the basename with the same encoding as the original" # NameError: uninitialized constant Encoding::Windows_1250
8
- fails "File.dirname returns all the components of filename except the last one (edge cases on windows)" # Expected "/" to equal "//foo"
9
- fails "File.dirname returns the return all the components of filename except the last one (Windows format)" # Expected "." to equal "C:\\foo\\bar"
10
- fails "File.dirname returns the return all the components of filename except the last one (forward_slash)" # Expected "." to equal "C:/"
11
- fails "File.dirname returns the return all the components of filename except the last one (windows unc)" # Expected "." to equal "\\\\foo\\bar"
12
- fails "File.expand_path expands C:/./dir to C:/dir" # Exception: cd is not defined
13
- fails "File.join respects given separator if only one part has a boundary separator" # Expected "C:\\/windows" to equal "C:\\windows"
14
- fails "Fixnum#to_s returns a String in US-ASCII encoding when Encoding.default_internal is nil" # NoMethodError: undefined method `default_internal' for Encoding
15
- fails "Fixnum#to_s returns a String in US-ASCII encoding when Encoding.default_internal is not nil" # NoMethodError: undefined method `default_internal' for Encoding
16
- fails "Float#to_s returns a String in US-ASCII encoding when Encoding.default_internal is nil" # NoMethodError: undefined method `default_internal' for Encoding
17
- fails "Float#to_s returns a String in US-ASCII encoding when Encoding.default_internal is not nil" # NoMethodError: undefined method `default_internal' for Encoding
18
4
  fails "Integer#to_s bignum returns a String in US-ASCII encoding when Encoding.default_internal is nil" # NoMethodError: undefined method `default_internal' for Encoding
19
5
  fails "Integer#to_s bignum returns a String in US-ASCII encoding when Encoding.default_internal is not nil" # NoMethodError: undefined method `default_internal' for Encoding
20
6
  fails "Integer#to_s bignum when given a base raises an ArgumentError if the base is less than 2 or higher than 36" # NoMethodError: undefined method `default_internal' for Encoding
@@ -31,7 +17,6 @@ opal_filter "Encoding" do
31
17
  fails "Marshal.dump with a String dumps a US-ASCII String" # Expected "\u0004\b\"\babc" to equal "\u0004\bI\"\babc\u0006:\u0006EF"
32
18
  fails "Marshal.dump with a String dumps a UTF-8 String" # Expected "\u0004\b\"\nmöhre" to equal "\u0004\bI\"\vmöhre\u0006:\u0006ET"
33
19
  fails "Marshal.dump with a String dumps multiple strings using symlinks for the :E (encoding) symbol" # Expected "\u0004\b[\a\"\u0000@\u0006" to equal "\u0004\b[\aI\"\u0000\u0006:\u0006EFI\"\u0000\u0006;\u0000T"
34
- fails "Marshal.load for a String loads a String as ASCII-8BIT if no encoding is specified at the end" # ArgumentError: marshal data too short
35
20
  fails "Marshal.load for a String loads a String in another encoding" # NameError: 'encoding' is not allowed as an instance variable name
36
21
  fails "Marshal.load for a String loads a US-ASCII String" # Expected #<Encoding:UTF-16LE> to be identical to #<Encoding:ASCII-8BIT (dummy)>
37
22
  fails "MatchData#post_match sets an empty result to the encoding of the source String" # NameError: uninitialized constant Encoding::ISO_8859_1
@@ -45,18 +30,8 @@ opal_filter "Encoding" do
45
30
  fails "Predefined global $` sets an empty result to the encoding of the source String" # NameError: uninitialized constant Encoding::ISO_8859_1
46
31
  fails "Predefined global $` sets the encoding to the encoding of the source String" # NameError: uninitialized constant Encoding::EUC_JP
47
32
  fails "Predefined globals $1..N sets the encoding to the encoding of the source String" # NameError: uninitialized constant Encoding::EUC_JP
48
- fails "Proc#inspect for a proc created with Proc.new has an ASCII-8BIT encoding" # Expected #<Encoding:UTF-16LE> to equal #<Encoding:ASCII-8BIT (dummy)>
49
- fails "Proc#inspect for a proc created with UnboundMethod#to_proc has an ASCII-8BIT encoding" # Expected #<Encoding:UTF-16LE> to equal #<Encoding:ASCII-8BIT (dummy)>
50
- fails "Proc#inspect for a proc created with lambda has an ASCII-8BIT encoding" # Expected #<Encoding:UTF-16LE> to equal #<Encoding:ASCII-8BIT (dummy)>
51
- fails "Proc#inspect for a proc created with proc has an ASCII-8BIT encoding" # Expected #<Encoding:UTF-16LE> to equal #<Encoding:ASCII-8BIT (dummy)>
52
- fails "Proc#to_s for a proc created with Proc.new has an ASCII-8BIT encoding" # Expected #<Encoding:UTF-16LE> to equal #<Encoding:ASCII-8BIT (dummy)>
53
- fails "Proc#to_s for a proc created with UnboundMethod#to_proc has an ASCII-8BIT encoding" # Expected #<Encoding:UTF-16LE> to equal #<Encoding:ASCII-8BIT (dummy)>
54
- fails "Proc#to_s for a proc created with lambda has an ASCII-8BIT encoding" # Expected #<Encoding:UTF-16LE> to equal #<Encoding:ASCII-8BIT (dummy)>
55
- fails "Proc#to_s for a proc created with proc has an ASCII-8BIT encoding" # Expected #<Encoding:UTF-16LE> to equal #<Encoding:ASCII-8BIT (dummy)>
56
33
  fails "Regexp#match with [string, position] when given a negative position raises an ArgumentError for an invalid encoding" # NoMethodError: undefined method `pack' for [150]:Array
57
34
  fails "Regexp#match with [string, position] when given a positive position raises an ArgumentError for an invalid encoding" # NoMethodError: undefined method `pack' for [150]:Array
58
- fails "Ruby String interpolation creates a String having an Encoding compatible with all components" # Expected #<Encoding:UTF-16LE> to equal #<Encoding:UTF-8>
59
- fails "Ruby String interpolation creates a String having the Encoding of the components when all are the same Encoding" # ArgumentError: unknown encoding name - euc-jp
60
35
  fails "Ruby String interpolation raises an Encoding::CompatibilityError if the Encodings are not compatible" # Expected Encoding::CompatibilityError but no exception was raised ("あ ÿ" was returned)
61
36
  fails "Source files encoded in UTF-16 BE with a BOM are invalid because they contain an invalid UTF-8 sequence before the encoding comment" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x7a11e>
62
37
  fails "Source files encoded in UTF-16 BE without a BOM are parsed as empty because they contain a NUL byte before the encoding comment" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x7a11e>
@@ -66,24 +41,6 @@ opal_filter "Encoding" do
66
41
  fails "Source files encoded in UTF-8 without a BOM can be parsed" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x7a11e>
67
42
  fails "String#% output's encoding negotiates a compatible encoding if necessary" # Expected #<Encoding:UTF-16LE> to equal #<Encoding:ASCII-8BIT (dummy)>
68
43
  fails "String#* raises an ArgumentError if the length of the resulting string doesn't fit into a long" # RangeError: multiply count must not overflow maximum string size
69
- fails "String#[]= with Fixnum index calls #to_int to convert the index" # Mock 'string element set' expected to receive 'to_int' exactly 1 times but received it 0 times
70
- fails "String#[]= with Fixnum index encodes the String in an encoding compatible with the replacement" # NoMethodError: undefined method `pack' for [160]:Array
71
- fails "String#[]= with Fixnum index raises a TypeError if #to_int does not return an Fixnum" # Mock 'string element set' expected to receive 'to_int' exactly 1 times but received it 0 times
72
- fails "String#[]= with Fixnum index raises a TypeError if passed a Fixnum replacement" # NoMethodError: undefined method `[]=' for "abc":String
73
- fails "String#[]= with Fixnum index raises an Encoding::CompatibilityError if the replacement encoding is incompatible" # NameError: uninitialized constant Encoding::EUC_JP
74
- fails "String#[]= with Fixnum index raises an IndexError if #to_int returns a value out of range" # Mock 'string element set' expected to receive 'to_int' exactly 1 times but received it 0 times
75
- fails "String#[]= with Fixnum index raises an IndexError if the index is greater than character size" # NoMethodError: undefined method `[]=' for "あれ":String
76
- fails "String#[]= with Fixnum index replaces a character with a multibyte character" # NoMethodError: undefined method `[]=' for "ありがとu":String
77
- fails "String#[]= with Fixnum index replaces a multibyte character with a character" # NoMethodError: undefined method `[]=' for "ありがとう":String
78
- fails "String#[]= with Fixnum index replaces a multibyte character with a multibyte character" # NoMethodError: undefined method `[]=' for "ありがとお":String
79
- fails "String#[]= with Fixnum index, count deletes a multibyte character" # NoMethodError: undefined method `[]=' for "ありとう":String
80
- fails "String#[]= with Fixnum index, count encodes the String in an encoding compatible with the replacement" # NoMethodError: undefined method `pack' for [160]:Array
81
- fails "String#[]= with Fixnum index, count inserts a multibyte character" # NoMethodError: undefined method `[]=' for "ありとう":String
82
- fails "String#[]= with Fixnum index, count raises an Encoding::CompatibilityError if the replacement encoding is incompatible" # NameError: uninitialized constant Encoding::EUC_JP
83
- fails "String#[]= with Fixnum index, count raises an IndexError if the character index is out of range of a multibyte String" # NoMethodError: undefined method `[]=' for "あれ":String
84
- fails "String#[]= with Fixnum index, count replaces characters with a multibyte character" # NoMethodError: undefined method `[]=' for "ありgaとう":String
85
- fails "String#[]= with Fixnum index, count replaces multibyte characters with characters" # NoMethodError: undefined method `[]=' for "ありがとう":String
86
- fails "String#[]= with Fixnum index, count replaces multibyte characters with multibyte characters" # NoMethodError: undefined method `[]=' for "ありがとう":String
87
44
  fails "String#[]= with String index encodes the String in an encoding compatible with the replacement" # NoMethodError: undefined method `pack' for [160]:Array
88
45
  fails "String#[]= with String index raises an Encoding::CompatibilityError if the replacement encoding is incompatible" # NameError: uninitialized constant Encoding::EUC_JP
89
46
  fails "String#[]= with String index replaces characters with a multibyte character" # NoMethodError: undefined method `[]=' for "ありgaとう":String
@@ -105,8 +62,6 @@ opal_filter "Encoding" do
105
62
  fails "String#ascii_only? returns false after appending non ASCII characters to an empty String" # NotImplementedError: String#<< not supported. Mutable String methods are not supported in Opal.
106
63
  fails "String#ascii_only? returns false when concatenating an ASCII and non-ASCII String" # NoMethodError: undefined method `concat' for "":String
107
64
  fails "String#ascii_only? returns false when replacing an ASCII String with a non-ASCII String" # NoMethodError: undefined method `replace' for "":String
108
- fails "String#ascii_only? with non-ASCII only characters returns false if the encoding is ASCII-8BIT" # Expected #<Encoding:UTF-16LE> to equal #<Encoding:ASCII-8BIT (dummy)>
109
- fails "String#b copies own tainted/untrusted status to the returning value" # NoMethodError: undefined method `untrust' for "こんちには":String
110
65
  fails "String#b returns new string without modifying self" # NoMethodError: undefined method `b' for "こんちには":String
111
66
  fails "String#byteslice on on non ASCII strings returns byteslice of unicode strings" # Expected nil to equal "\u0081"
112
67
  fails "String#center with length, padding with width returns a String in the same encoding as the original" # NameError: uninitialized constant Encoding::IBM437
@@ -114,19 +69,16 @@ opal_filter "Encoding" do
114
69
  fails "String#center with length, padding with width, pattern returns a String in the compatible encoding" # NameError: uninitialized constant Encoding::IBM437
115
70
  fails "String#chars returns a different character if the String is transcoded" # ArgumentError: unknown encoding name - iso-8859-15
116
71
  fails "String#chars returns characters in the same encoding as self" # ArgumentError: unknown encoding name - Shift_JIS
117
- fails "String#chars taints resulting strings when self is tainted" # Expected false to equal true
118
72
  fails "String#chars uses the String's encoding to determine what characters it contains" # Expected ["�", "�"] to equal ["𤭢"]
119
73
  fails "String#chars works if the String's contents is invalid for its encoding" # NoMethodError: undefined method `pack' for [164]:Array
120
74
  fails "String#chr returns a String in the same encoding as self" # Expected #<Encoding:UTF-16LE> to equal #<Encoding:ASCII-8BIT (dummy)>
121
75
  fails "String#chr returns a copy of self" # Expected "e" not to equal "e"
122
- fails "String#codepoints is synonomous with #bytes for Strings which are single-byte optimisable" # Expected false to be true
123
76
  fails "String#codepoints raises an ArgumentError if self's encoding is invalid and a block is given" # Expected true to be false
124
77
  fails "String#codepoints raises an ArgumentError when no block is given if self has an invalid encoding" # Expected true to be false
125
78
  fails "String#codepoints raises an ArgumentError when self has an invalid encoding and a method is called on the returned Enumerator" # Expected true to be false
126
79
  fails "String#codepoints round-trips to the original String using Integer#chr" # Expected "\u0013眑တ" to equal ""
127
80
  fails "String#each_char returns a different character if the String is transcoded" # ArgumentError: unknown encoding name - iso-8859-15
128
81
  fails "String#each_char returns characters in the same encoding as self" # ArgumentError: unknown encoding name - Shift_JIS
129
- fails "String#each_char taints resulting strings when self is tainted" # Expected false to equal true
130
82
  fails "String#each_char uses the String's encoding to determine what characters it contains" # Expected ["�", "�"] to equal ["𤭢"]
131
83
  fails "String#each_char works if the String's contents is invalid for its encoding" # NoMethodError: undefined method `pack' for [164]:Array
132
84
  fails "String#each_codepoint raises an ArgumentError if self's encoding is invalid and a block is given" # Expected true to be false
@@ -158,6 +110,14 @@ opal_filter "Encoding" do
158
110
  fails "String#encode when passed options normalizes newlines" # NoMethodError: undefined method `default_internal' for Encoding
159
111
  fails "String#encode when passed options raises an Encoding::ConverterNotFoundError when no conversion is possible despite 'invalid: :replace, undef: :replace'" # NoMethodError: undefined method `default_internal' for Encoding
160
112
  fails "String#encode when passed options replaces invalid characters when replacing Emacs-Mule encoded strings" # NoMethodError: undefined method `default_internal' for Encoding
113
+ fails "String#encode when passed options replaces invalid encoding in source using a specified replacement even when a fallback is given" # NoMethodError: undefined method `default_internal' for Encoding
114
+ fails "String#encode when passed options replaces invalid encoding in source using replace even when fallback is given as proc" # NoMethodError: undefined method `default_internal' for Encoding
115
+ fails "String#encode when passed options replaces invalid encoding in source with a specified replacement" # NoMethodError: undefined method `default_internal' for Encoding
116
+ fails "String#encode when passed options replaces invalid encoding in source with default replacement" # NoMethodError: undefined method `default_internal' for Encoding
117
+ fails "String#encode when passed options replaces undefined encoding in destination using a fallback proc" # NoMethodError: undefined method `default_internal' for Encoding
118
+ fails "String#encode when passed options replaces undefined encoding in destination with a specified replacement even if a fallback is given" # NoMethodError: undefined method `default_internal' for Encoding
119
+ fails "String#encode when passed options replaces undefined encoding in destination with a specified replacement" # NoMethodError: undefined method `default_internal' for Encoding
120
+ fails "String#encode when passed options replaces undefined encoding in destination with default replacement" # NoMethodError: undefined method `default_internal' for Encoding
161
121
  fails "String#encode when passed options returns a copy when Encoding.default_internal is nil" # NoMethodError: undefined method `default_internal' for Encoding
162
122
  fails "String#encode when passed options transcodes to Encoding.default_internal when set" # NoMethodError: undefined method `default_internal' for Encoding
163
123
  fails "String#encode when passed to encoding accepts a String argument" # NoMethodError: undefined method `default_internal' for Encoding
@@ -192,7 +152,6 @@ opal_filter "Encoding" do
192
152
  fails "String#encoding for Strings with \\x escapes is not affected by both the default internal and external encoding being set at the same time" # NoMethodError: undefined method `default_internal' for Encoding
193
153
  fails "String#encoding for Strings with \\x escapes is not affected by the default external encoding" # NameError: uninitialized constant Encoding::SHIFT_JIS
194
154
  fails "String#encoding for Strings with \\x escapes is not affected by the default internal encoding" # NoMethodError: undefined method `default_internal' for Encoding
195
- fails "String#encoding for Strings with \\x escapes returns ASCII-8BIT 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)>
196
155
  fails "String#encoding for Strings with \\x escapes returns US-ASCII if self is US-ASCII only" # Expected false to be true
197
156
  fails "String#encoding for Strings with \\x escapes returns the given encoding if #encode!has been called" # NameError: uninitialized constant Encoding::SHIFT_JIS
198
157
  fails "String#encoding for Strings with \\x escapes returns the given encoding if #force_encoding has been called" # NameError: uninitialized constant Encoding::SHIFT_JIS
@@ -208,7 +167,6 @@ opal_filter "Encoding" do
208
167
  fails "String#force_encoding accepts an Encoding instance" # NameError: uninitialized constant Encoding::SHIFT_JIS
209
168
  fails "String#force_encoding calls #to_str to convert an object to an encoding name" # ArgumentError: unknown encoding name - #<MockObject:0xa7ea>
210
169
  fails "String#force_encoding does not transcode self" # Expected "蘒" not to equal "蘒"
211
- fails "String#force_encoding raises a RuntimeError if self is frozen" # Expected RuntimeError but no exception was raised ("abcd" was returned)
212
170
  fails "String#force_encoding raises a TypeError if #to_str does not return a String" # ArgumentError: unknown encoding name - #<MockObject:0xa7d8>
213
171
  fails "String#force_encoding raises a TypeError if passed nil" # ArgumentError: unknown encoding name -
214
172
  fails "String#force_encoding sets the encoding even if the String contents are invalid in that encoding" # ArgumentError: unknown encoding name - euc-jp
@@ -6,11 +6,14 @@ opal_filter "Enumerable" do
6
6
  fails "Enumerable#collect reports the same arity as the given block" # Exception: Cannot read property '$$is_array' of undefined
7
7
  fails "Enumerable#collect yields 2 arguments for a Hash when block arity is 2" # ArgumentError: [#register] wrong number of arguments(1 for 2)
8
8
  fails "Enumerable#first returns a gathered array from yield parameters"
9
+ fails "Enumerable#grep correctly handles non-string elements" # Expected nil == "match" to be truthy but was false
10
+ fails "Enumerable#grep does not modify Regexp.last_match without block" # NoMethodError: undefined method `[]' for nil
9
11
  fails "Enumerable#grep does not set $~ when given no block" # Expected nil == "z" to be truthy but was false
12
+ fails "Enumerable#grep_v correctly handles non-string elements" # Expected nil == "match" to be truthy but was false
13
+ fails "Enumerable#grep_v does not modify Regexp.last_match without block" # Expected "e" == "z" to be truthy but was false
10
14
  fails "Enumerable#grep_v does not set $~ when given no block" # Expected "e" == "z" to be truthy but was false
11
15
  fails "Enumerable#map reports the same arity as the given block" # Exception: Cannot read property '$$is_array' of undefined
12
16
  fails "Enumerable#map yields 2 arguments for a Hash when block arity is 2" # ArgumentError: [#register] wrong number of arguments(1 for 2)
13
- fails "Enumerable#none? given a pattern argument returns true iff none match that pattern" # Works, but depends on the difference between Integer and Float
14
17
  fails "Enumerable#reverse_each gathers whole arrays as elements when each yields multiple"
15
18
  fails "Enumerable#slice_when when an iterator method yields more than one value processes all yielded values"
16
19
  fails "Enumerable#slice_when when given a block doesn't yield an empty array on a small enumerable" # Expected [] to equal [[42]]
@@ -1,8 +1,5 @@
1
1
  # NOTE: run bin/format-filters after changing this file
2
2
  opal_filter "Enumerator" do
3
- fails "Enumerator#+ calls #each on each argument" # Mock 'obj1' expected to receive each("any_args") exactly 1 times but received it 0 times
4
- fails "Enumerator#+ returns a chain of self and provided enumerators" # NoMethodError: undefined method `+' for #<Enumerator: #<Enumerator::Generator:0x55192>:each>
5
- fails "Enumerator#enum_for exposes multi-arg yields as an array"
6
3
  fails "Enumerator#feed can be called for each iteration"
7
4
  fails "Enumerator#feed causes yield to return the value if called during iteration"
8
5
  fails "Enumerator#feed raises a TypeError if called more than once without advancing the enumerator"
@@ -10,41 +7,20 @@ opal_filter "Enumerator" do
10
7
  fails "Enumerator#feed sets the future return value of yield if called before advancing the iterator"
11
8
  fails "Enumerator#feed sets the return value of Yielder#yield"
12
9
  fails "Enumerator#initialize returns self when given a block"
13
- fails "Enumerator#initialize returns self when given an object"
14
10
  fails "Enumerator#initialize sets size to nil if size is not given"
15
11
  fails "Enumerator#initialize sets size to nil if the given size is nil"
16
12
  fails "Enumerator#initialize sets size to the given size if the given size is Float::INFINITY"
17
- fails "Enumerator#initialize sets size to the given size if the given size is a Fixnum"
18
13
  fails "Enumerator#initialize sets size to the given size if the given size is a Proc"
19
14
  fails "Enumerator#initialize sets size to the given size if the given size is an Integer" # Expected 4 == 100 to be truthy but was false
20
- fails "Enumerator#next restarts the enumerator if an exception terminated a previous iteration" # Expected [#<NoMethodError: undefined method `next' for #<Enumerator: #<Enumerator::Generator:0x4f2>:each>>, #<NoMethodError: undefined method `next' for #<Enumerator: #<Enumerator::Generator:0x4f2>:each>>] == [#<StandardError: StandardError>, #<StandardError: StandardError>] to be truthy but was false
21
- fails "Enumerator#next_values advances the position of the current element"
22
- fails "Enumerator#next_values advances the position of the enumerator each time when called multiple times"
23
- fails "Enumerator#next_values raises StopIteration if called on a finished enumerator"
24
- fails "Enumerator#next_values returns an array with only nil if yield is called with nil"
25
- fails "Enumerator#next_values returns an empty array if yield is called without arguments"
26
- fails "Enumerator#next_values returns the next element in self"
27
- fails "Enumerator#next_values works in concert with #rewind"
28
- fails "Enumerator#peek can be called repeatedly without advancing the position of the current element"
29
- fails "Enumerator#peek does not advance the position of the current element"
30
- fails "Enumerator#peek raises StopIteration if called on a finished enumerator"
31
- fails "Enumerator#peek returns the next element in self"
32
- fails "Enumerator#peek works in concert with #rewind"
33
- fails "Enumerator#peek_values can be called repeatedly without advancing the position of the current element"
34
- fails "Enumerator#peek_values does not advance the position of the current element"
35
- fails "Enumerator#peek_values raises StopIteration if called on a finished enumerator"
36
- fails "Enumerator#peek_values returns an array with only nil if yield is called with nil"
37
- fails "Enumerator#peek_values returns an empty array if yield is called without arguments"
38
- fails "Enumerator#peek_values returns the next element in self"
39
- fails "Enumerator#peek_values works in concert with #rewind"
40
- fails "Enumerator#to_enum exposes multi-arg yields as an array" # NoMethodError: undefined method `next' for #<Enumerator: #<Object:0x53e80>:each>
41
15
  fails "Enumerator.new no block given raises" # Expected ArgumentError but no exception was raised (#<Enumerator: 1:upto(3)> was returned)
42
- fails "Enumerator.new when passed a block defines iteration with block, yielder argument and treating it as a proc" # Expected [] == ["a\n", "b\n", "c"] to be truthy but was false
43
16
  fails "Enumerator.new when passed a block yielded values handles yield arguments properly" # Expected 1 == [1, 2] to be truthy but was false
44
17
  fails "Enumerator.produce creates an infinite enumerator" # NoMethodError: undefined method `produce' for Enumerator
45
18
  fails "Enumerator.produce terminates iteration when block raises StopIteration exception" # NoMethodError: undefined method `produce' for Enumerator
46
19
  fails "Enumerator.produce when initial value skipped starts enumerable from result of first block call" # NoMethodError: undefined method `produce' for Enumerator
47
20
  fails "Enumerator.produce when initial value skipped uses nil instead" # NoMethodError: undefined method `produce' for Enumerator
21
+ fails "Enumerator::ArithmeticSequence#hash is based on begin, end, step and exclude_end?" # Expected "A,3,21,3,0" (String) to be an instance of Integer
22
+ fails "Enumerator::ArithmeticSequence.allocate is not defined" # Expected TypeError (allocator undefined for Enumerator::ArithmeticSequence) but no exception was raised (#<Enumerator::ArithmeticSequence>(#pretty_inspect raised #<NoMethodError: undefined method `begin' for nil>) was returned)
23
+ fails "Enumerator::ArithmeticSequence.new is not defined" # Expected NoMethodError but got: ArgumentError ([ArithmeticSequence#initialize] wrong number of arguments (given 0, expected -2))
48
24
  fails "Enumerator::Generator#each returns the block returned value" # Expected #<Enumerator::Generator:0x74c7e> to be identical to "block_returned"
49
25
  fails "Enumerator::Generator#initialize returns self when given a block" # Expected #<Proc:0x1b2ee> to be identical to #<Enumerator::Generator:0x1b2e2>
50
26
  fails "Enumerator::Lazy defines lazy versions of a whitelist of Enumerator methods" # Expected ["initialize", "force", "lazy", "collect", "collect_concat", "drop", "drop_while", "enum_for", "filter", "find_all", "flat_map", "grep", "map", "select", "reject", "take", "take_while", "to_enum", "inspect"] to include "chunk"
@@ -78,11 +54,7 @@ opal_filter "Enumerator" do
78
54
  fails "Enumerator::Lazy#enum_for passes given arguments to wrapped method" # Expected [] == [0, 6, 20, 42] to be truthy but was false
79
55
  fails "Enumerator::Lazy#enum_for works with an infinite enumerable" # TypeError: can't iterate from Float
80
56
  fails "Enumerator::Lazy#filter calls the block with a gathered array when yield with multiple arguments" # NoMethodError: undefined method `force' for [[], 0, [0, 1], [0, 1, 2], [0, 1, 2], nil, "default_arg", [], [], [0], [0, 1], [0, 1, 2]]
81
- fails "Enumerator::Lazy#filter on a nested Lazy sets #size to nil" # Expected 0 == nil to be truthy but was false
82
57
  fails "Enumerator::Lazy#filter on a nested Lazy when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times" # Expected [] == [6, 8, 10] to be truthy but was false
83
- fails "Enumerator::Lazy#filter raises an ArgumentError when not given a block" # Expected ArgumentError but no exception was raised (#<Enumerator::Lazy: nil> was returned)
84
- fails "Enumerator::Lazy#filter returns a new instance of Enumerator::Lazy" # Expected [] (Array) to be an instance of Enumerator::Lazy
85
- fails "Enumerator::Lazy#filter sets #size to nil" # Expected 0 == nil to be truthy but was false
86
58
  fails "Enumerator::Lazy#filter when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times" # Expected [] == [0, 2, 4] to be truthy but was false
87
59
  fails "Enumerator::Lazy#filter works with an infinite enumerable" # TypeError: can't iterate from Float
88
60
  fails "Enumerator::Lazy#filter_map does not map false results" # Expected [] == [1, 3, 5, 7] to be truthy but was false
@@ -128,7 +100,6 @@ opal_filter "Enumerator" do
128
100
  fails "Enumerator::Lazy#map when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times" # Expected [] == [1, 2, 3] to be truthy but was false
129
101
  fails "Enumerator::Lazy#map works with an infinite enumerable" # TypeError: can't iterate from Float
130
102
  fails "Enumerator::Lazy#reject calls the block with a gathered array when yield with multiple arguments" # Expected [nil, 0, 0, 0, 0, nil, "default_arg", [], [], [0], [0, 1], [0, 1, 2]] == [nil, 0, [0, 1], [0, 1, 2], [0, 1, 2], nil, "default_arg", [], [], [0], [0, 1], [0, 1, 2]] to be truthy but was false
131
- fails "Enumerator::Lazy#reject lets exceptions raised in the block go through" # Expected RuntimeError (foo) but no exception was raised (#<Enumerator::Generator:0x44bec> was returned)
132
103
  fails "Enumerator::Lazy#reject on a nested Lazy when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times" # Expected [] == [5, 7, 9] to be truthy but was false
133
104
  fails "Enumerator::Lazy#reject when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times" # Expected [] == [1, 3, 5] to be truthy but was false
134
105
  fails "Enumerator::Lazy#reject works with an infinite enumerable" # TypeError: can't iterate from Float
@@ -168,7 +139,6 @@ opal_filter "Enumerator" do
168
139
  fails "Enumerator::Lazy#with_index enumerates with an index starting at 0 when offset is nil" # Expected [] == [[0, 0], [1, 1], [2, 2]] to be truthy but was false
169
140
  fails "Enumerator::Lazy#with_index enumerates with an index starting at a given offset" # Expected [] == [[0, 3], [1, 4], [2, 5]] to be truthy but was false
170
141
  fails "Enumerator::Lazy#with_index enumerates with an index" # Expected [] == [[0, 0], [1, 1], [2, 2]] to be truthy but was false
171
- fails "Enumerator::Lazy#with_index raises TypeError when offset does not convert to Integer" # Expected TypeError but no exception was raised ([] was returned)
172
142
  fails "Enumerator::Lazy#zip calls the block with a gathered array when yield with multiple arguments" # NoMethodError: undefined method `force' for [[[], []], [0, 0], [[0, 1], [0, 1]], [[0, 1, 2], [0, 1, 2]], [[0, 1, 2], [0, 1, 2]], [nil, nil], ["default_arg", "default_arg"], [[], []], [[], []], [[0], [0]], [[0, 1], [0, 1]], [[0, 1, 2], [0, 1, 2]]]
173
143
  fails "Enumerator::Lazy#zip keeps size" # Expected 0 == 100 to be truthy but was false
174
144
  fails "Enumerator::Lazy#zip on a nested Lazy keeps size" # Expected 0 == 100 to be truthy but was false
@@ -179,7 +149,4 @@ opal_filter "Enumerator" do
179
149
  fails "Enumerator::Lazy#zip when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times" # Expected [] == [[0, 4, 8], [1, 5, nil]] to be truthy but was false
180
150
  fails "Enumerator::Lazy#zip works with an infinite enumerable and an array" # TypeError: can't iterate from Float
181
151
  fails "Enumerator::Lazy#zip works with two infinite enumerables" # TypeError: can't iterate from Float
182
- fails "Enumerator::Yielder#<< when multiple arguments passed raises an ArgumentError" # Expected ArgumentError (/wrong number of arguments/) but no exception was raised (#<Enumerator::Yielder:0x4b442> was returned)
183
- fails "Enumerator::Yielder#initialize returns self when given a block" # Expected #<Proc:0x3d4f8> to be identical to #<Enumerator::Yielder:0x3d4ec>
184
- fails "Enumerator::Yielder#to_proc returns a Proc object that takes an argument and yields it to the block" # Expected Enumerator::Yielder == Proc to be truthy but was false
185
152
  end
@@ -7,7 +7,6 @@ opal_filter "Exception" do
7
7
  fails "Errno::EINVAL.new accepts an optional custom message and location" # ArgumentError: [EINVAL.new] wrong number of arguments(2 for -1)
8
8
  fails "Errno::EINVAL.new accepts an optional custom message" # NoMethodError: undefined method `errno' for #<Errno::EINVAL: Invalid argument - custom message>
9
9
  fails "Errno::EINVAL.new can be called with no arguments" # NoMethodError: undefined method `errno' for #<Errno::EINVAL: Invalid argument>
10
- fails "Errno::EMFILE can be subclassed" # NameError: uninitialized constant Errno::EMFILE
11
10
  fails "Errno::ENOTSUP is defined" # Expected Errno to have constant 'ENOTSUP' but it does not
12
11
  fails "Errno::ENOTSUP is the same class as Errno::EOPNOTSUPP if they represent the same errno value" # NameError: uninitialized constant Errno::ENOTSUP
13
12
  fails "Exception#== returns true if both exceptions have the same class, no message, and no backtrace" # Expected #<RuntimeError: RuntimeError> == #<RuntimeError: RuntimeError> to be truthy but was false
@@ -74,7 +73,6 @@ opal_filter "Exception" do
74
73
  fails "StopIteration#result returns the method-returned-object from an Enumerator" # NoMethodError: undefined method `next' for #<Enumerator: #<Object:0x4fb42>:each>
75
74
  fails "SystemCallError#backtrace is nil if not raised" # Expected ["ruby/core/exception/system_call_error_spec.rb:141:5:in `new'", "<internal:corelib/basic_object.rb>:119:1:in `instance_exec'", "<internal:corelib/runtime.js>:1780:5:in `Opal.send2'", "<internal:corelib/runtime.js>:1770:5:in `Opal.send'", "mspec/runner/mspec.rb:114:7:in `instance_exec'", "<internal:corelib/runtime.js>:1780:5:in `Opal.send2'", "<internal:corelib/runtime.js>:1770:5:in `Opal.send'", "mspec/runner/context.rb:176:34:in `protect'", "<internal:corelib/runtime.js>:1569:5:in `Opal.yieldX'", "<internal:corelib/enumerable.rb>:27:16:in `$$3'"] == nil to be truthy but was false
76
75
  fails "SystemCallError#dup copies the errno" # NoMethodError: undefined method `errno' for #<SystemCallError: message>
77
- fails "SystemCallError#errno returns nil when no errno given" # NoMethodError: undefined method `errno' for #<SystemCallError: message>
78
76
  fails "SystemCallError#errno returns the errno given as optional argument to new" # NoMethodError: undefined method `errno' for #<SystemCallError: message>
79
77
  fails "SystemCallError#message returns the default message when no message is given" # Expected "268435456" =~ /Unknown error/i to be truthy but was nil
80
78
  fails "SystemCallError.=== returns false if errnos different" # NoMethodError: undefined method `+' for Errno
@@ -19,11 +19,9 @@ opal_filter "File" do
19
19
  fails "File.expand_path does not modify the string argument" # Expected "a/c" to equal "/a/c"
20
20
  fails "File.expand_path does not replace multiple '/' at the beginning of the path" # ArgumentError: [Dir.home] wrong number of arguments(1 for 0)
21
21
  fails "File.expand_path expand path with" # ArgumentError: [Dir.home] wrong number of arguments(1 for 0)
22
- fails "File.expand_path expand_path for commoms unix path give a full path" # ArgumentError: [Dir.home] wrong number of arguments(1 for 0)
23
22
  fails "File.expand_path expand_path for common unix path gives a full path" # ArgumentError: [Dir.home] wrong number of arguments(1 for 0)
24
23
  fails "File.expand_path expands ../foo with ~/dir as base dir to /path/to/user/home/foo" # ArgumentError: [Dir.home] wrong number of arguments(1 for 0)
25
24
  fails "File.expand_path expands /./dir to /dir" # ArgumentError: [Dir.home] wrong number of arguments(1 for 0)
26
- fails "File.expand_path expands a path when the default external encoding is ASCII-8BIT" # ArgumentError: [Dir.home] wrong number of arguments(1 for 0)
27
25
  fails "File.expand_path expands a path when the default external encoding is BINARY" # ArgumentError: [Dir.home] wrong number of arguments(1 for 0)
28
26
  fails "File.expand_path expands a path with multi-byte characters" # Expected "Ångström" to equal "/Ångström"
29
27
  fails "File.expand_path expands ~ENV['USER'] to the user's home directory" # Expected "./~elia" to equal "/Users/elia"
@@ -41,7 +41,6 @@ opal_filter "Float" do
41
41
  fails "Float#prev_float returns a float the smallest possible step smaller than the receiver"
42
42
  fails "Float#prev_float returns positive zero when stepping downward from just above zero"
43
43
  fails "Float#prev_float reverses the effect of next_float for all Floats except -INFINITY and -0.0" # NoMethodError: undefined method `next_float' for 0.7192216026596725
44
- fails "Float#prev_float reverses the effect of next_float"
45
44
  fails "Float#prev_float steps directly between -1.0 and -1.0 - EPSILON"
46
45
  fails "Float#prev_float steps directly between 1.0 and 1.0 - EPSILON/2"
47
46
  fails "Float#prev_float steps directly between MAX and INFINITY"
@@ -66,9 +65,7 @@ opal_filter "Float" do
66
65
  fails "Float#to_s uses e format for a positive value with whole part having 18 significant figures"
67
66
  fails "Float#to_s uses non-e format for a negative value with whole part having 15 significant figures"
68
67
  fails "Float#to_s uses non-e format for a negative value with whole part having 16 significant figures"
69
- fails "Float#to_s uses non-e format for a negative value with whole part having 17 significant figures"
70
68
  fails "Float#to_s uses non-e format for a positive value with whole part having 15 significant figures"
71
69
  fails "Float#to_s uses non-e format for a positive value with whole part having 16 significant figures"
72
- fails "Float#to_s uses non-e format for a positive value with whole part having 17 significant figures"
73
70
  fails "Float#truncate returns self truncated to an Integer"
74
71
  end
@@ -9,12 +9,9 @@ opal_filter "Hash" do
9
9
  fails "Hash#[]= does not dispatch to hash for Boolean, Integer, Float, String, or Symbol" # NoMethodError: undefined method `insert' for "rubyexe.rb"
10
10
  fails "Hash#[]= keeps the existing String key in the hash if there is a matching one" # Expected "foo" not to be identical to "foo"
11
11
  fails "Hash#compare_by_identity gives different identity for string literals" # Expected [2] to equal [1, 2]
12
- fails "Hash#deconstruct_keys requires one argument" # Expected ArgumentError (/wrong number of arguments \(given 0, expected 1\)/) but got: ArgumentError ([Hash#deconstruct_keys] wrong number of arguments(0 for 1))
13
12
  fails "Hash#delete allows removing a key while iterating" # Exception: Cannot read property '$$is_string' of undefined
14
13
  fails "Hash#each always yields an Array of 2 elements, even when given a callable of arity 2" # Expected ArgumentError but no exception was raised ({"a"=>1} was returned)
15
- fails "Hash#each yields 2 values and not an Array of 2 elements when given a callable of arity 2" # ArgumentError: [Object#foo] wrong number of arguments(1 for 2)
16
14
  fails "Hash#each_pair always yields an Array of 2 elements, even when given a callable of arity 2" # Expected ArgumentError but no exception was raised ({"a"=>1} was returned)
17
- fails "Hash#each_pair yields 2 values and not an Array of 2 elements when given a callable of arity 2" # ArgumentError: [Object#foo] wrong number of arguments(1 for 2)
18
15
  fails "Hash#eql? compares keys with eql? semantics" # spec relies on integer and float being different
19
16
  fails "Hash#eql? computes equality for complex recursive hashes"
20
17
  fails "Hash#eql? computes equality for recursive hashes & arrays"
@@ -38,6 +35,11 @@ opal_filter "Hash" do
38
35
  fails "Hash#to_s does not call #to_s on a String returned from #inspect" # Expected "{\"a\"=>\"abc\"}" to equal "{:a=>\"abc\"}"
39
36
  fails "Hash#to_s does not call #to_str on the object returned from #inspect when it is not a String" # Expected "{\"a\"=>#<MockObject:0x1b948>}" to match /^\{:a=>#<MockObject:0x[0-9a-f]+>\}$/
40
37
  fails "Hash#to_s does not call #to_str on the object returned from #to_s when it is not a String" # Exception: Cannot convert object to primitive value
38
+ fails "Hash#transform_keys allows a combination of hash and block argument" # ArgumentError: [Hash#transform_keys] wrong number of arguments(1 for 0)
39
+ fails "Hash#transform_keys allows a hash argument" # ArgumentError: [Hash#transform_keys] wrong number of arguments(1 for 0)
40
+ fails "Hash#transform_keys allows a partial transformation of keys when using a hash argument" # ArgumentError: [Hash#transform_keys] wrong number of arguments(1 for 0)
41
+ fails "Hash#transform_keys! allows a hash argument" # ArgumentError: [Hash#transform_keys!] wrong number of arguments(1 for 0)
42
+ fails "Hash#transform_keys! on frozen instance raises a FrozenError on hash argument" # Expected FrozenError but got: ArgumentError ([Hash#transform_keys!] wrong number of arguments(1 for 0))
41
43
  fails "Hash#transform_keys! prevents conflicts between new keys and old ones" # Expected {"e"=>1} to equal {"b"=>1, "c"=>2, "d"=>3, "e"=>4}
42
44
  fails "Hash#transform_keys! returns the processed keys and non evaluated keys if we broke from the block" # Expected {"c"=>1, "d"=>4} == {"b"=>1, "c"=>2, "d"=>4} to be truthy but was false
43
45
  fails "Hash.[] raises for elements that are not arrays" # Expected ArgumentError but no exception was raised (nil was returned)
@@ -11,6 +11,7 @@ opal_filter "Integer" do
11
11
  fails "Integer#** fixnum raises a ZeroDivisionError for 0 ** -1" # Expected ZeroDivisionError but no exception was raised (Infinity was returned)
12
12
  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: ""
13
13
  fails "Integer#** fixnum returns self raised to the given power" # Exception: Maximum call stack size exceeded
14
+ fails "Integer#+ can be redefined" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x31b0a @method="+" @object=nil>
14
15
  fails "Integer#/ fixnum coerces fixnum and return self divided by other" # Expected 1.0842021724855044e-19 to equal 0
15
16
  fails "Integer#/ fixnum raises a ZeroDivisionError if the given argument is zero and not a Float" # Expected ZeroDivisionError but no exception was raised (Infinity was returned)
16
17
  fails "Integer#/ fixnum returns result the same class as the argument" # Expected 1.5 to equal 1
@@ -46,13 +47,11 @@ opal_filter "Integer" do
46
47
  fails "Integer#chr without argument raises a RangeError is self is less than 0"
47
48
  fails "Integer#chr without argument returns a new String for each call"
48
49
  fails "Integer#chr without argument when Encoding.default_internal is nil and self is between 0 and 127 (inclusive) returns a US-ASCII String"
49
- fails "Integer#chr without argument when Encoding.default_internal is nil and self is between 128 and 255 (inclusive) returns an ASCII-8BIT String"
50
50
  fails "Integer#chr without argument when Encoding.default_internal is nil raises a RangeError is self is greater than 255"
51
51
  fails "Integer#chr without argument when Encoding.default_internal is not nil and self is between 0 and 127 (inclusive) returns a String encoding self interpreted as a US-ASCII codepoint"
52
52
  fails "Integer#chr without argument when Encoding.default_internal is not nil and self is between 0 and 127 (inclusive) returns a US-ASCII String"
53
53
  fails "Integer#chr without argument when Encoding.default_internal is not nil and self is between 128 and 255 (inclusive) returns a String containing self interpreted as a byte"
54
54
  fails "Integer#chr without argument when Encoding.default_internal is not nil and self is between 128 and 255 (inclusive) returns a binary String" # NoMethodError: undefined method `default_internal' for Encoding
55
- fails "Integer#chr without argument when Encoding.default_internal is not nil and self is between 128 and 255 (inclusive) returns an ASCII-8BIT String"
56
55
  fails "Integer#chr without argument when Encoding.default_internal is not nil and self is greater than 255 raises RangeError if self is invalid as a codepoint in the default internal encoding"
57
56
  fails "Integer#chr without argument when Encoding.default_internal is not nil and self is greater than 255 returns a String encoding self interpreted as a codepoint in the default internal encoding"
58
57
  fails "Integer#chr without argument when Encoding.default_internal is not nil and self is greater than 255 returns a String with the default internal encoding"
@@ -66,10 +65,10 @@ opal_filter "Integer" do
66
65
  fails "Integer#pow one argument is passed fixnum returns self raised to the given power" # Exception: Maximum call stack size exceeded
67
66
  fails "Integer#pow two arguments are passed raises a RangeError when the first argument is negative and the second argument is present" # Expected RangeError but got: TypeError (Integer#pow() 1st argument cannot be negative when 2nd argument specified)
68
67
  fails "Integer#round raises ArgumentError for an unknown rounding mode" # ArgumentError: [Number#round] wrong number of arguments(2 for -1)
69
- fails "Integer#round raises a RangeError when passed a big negative value" # Expected RangeError but no exception was raised (0 was returned)
70
68
  fails "Integer#round returns different rounded values depending on the half option" # ArgumentError: [Number#round] wrong number of arguments(2 for -1)
71
69
  fails "Integer#round returns itself if passed a positive precision and the half option" # ArgumentError: [Number#round] wrong number of arguments(2 for -1)
72
70
  fails "Integer#round returns itself rounded to nearest if passed a negative value" # Expected NaN to have same value and type as 300
71
+ fails "Integer#zero? Integer#zero? overrides Numeric#zero?" # Expected Number == Integer to be truthy but was false
73
72
  fails "Integer#| fixnum raises a TypeError when passed a Float" # Expected TypeError but no exception was raised (3 was returned)
74
73
  fails "Integer#| fixnum returns self bitwise OR other" # Expected 65535 to equal 9223372036854841000
75
74
  fails "Integer.sqrt returns the integer square root of the argument" # Number overflow, 10**400
@@ -37,15 +37,11 @@ opal_filter "Kernel" do
37
37
  fails "Kernel#String calls #to_s if #respond_to?(:to_s) returns true" # TypeError: no implicit conversion of MockObject into String
38
38
  fails "Kernel#String raises a TypeError if #to_s is not defined, even though #respond_to?(:to_s) returns true"
39
39
  fails "Kernel#__dir__ returns the expanded path of the directory when used in the main script" # NoMethodError: undefined method `insert' for "rubyexe.rb"
40
- fails "Kernel#__dir__ returns the real name of the directory containing the currently-executing file"
41
- fails "Kernel#__dir__ when used in eval with a given filename returns File.dirname(filename)" # ArgumentError: [MSpecEnv#eval] wrong number of arguments(3 for 1)
42
40
  fails "Kernel#__dir__ when used in eval with top level binding returns nil" # NoMethodError: undefined method `binding' for #<MSpecEnv:0x5b3aa>
43
- fails "Kernel#__dir__ when used in eval with top level binding returns the real name of the directory containing the currently-executing file"
44
41
  fails "Kernel#autoload calls main.require(path) to load the file" # NameError: uninitialized constant TOPLEVEL_BINDING
45
42
  fails "Kernel#autoload can autoload in instance_eval" # NameError: uninitialized constant KSAutoloadD
46
43
  fails "Kernel#autoload inside a Class.new method body should define on the new anonymous class" # NoMethodError: undefined method `autoload?' for #<#<Class:0x61d4a>:0x61d48>
47
44
  fails "Kernel#autoload is a private method" # Expected Kernel to have private instance method 'autoload' but it does not
48
- fails "Kernel#autoload registers a file to load the first time the named constant is accessed" # NoMethodError: undefined method `autoload?' for #<MSpecEnv:0x5b168>
49
45
  fails "Kernel#autoload when Object is frozen raises a FrozenError before defining the constant" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x7849c>
50
46
  fails "Kernel#autoload when called from included module's method setups the autoload on the included module" # NoMethodError: undefined method `autoload?' for KernelSpecs::AutoloadMethod
51
47
  fails "Kernel#autoload when called from included module's method the autoload is reachable from the class too" # NoMethodError: undefined method `autoload?' for KernelSpecs::AutoloadMethodIncluder
@@ -61,14 +57,10 @@ opal_filter "Kernel" do
61
57
  fails "Kernel#caller works with beginless ranges" # TypeError: no implicit conversion of NilClass into Integer
62
58
  fails "Kernel#caller works with endless ranges" # Opal::SyntaxError: undefined method `type' for nil
63
59
  fails "Kernel#class returns the class of the object"
64
- fails "Kernel#clone copies frozen?" # Expected false to be true
65
- fails "Kernel#clone copies tainted?" # Expected false to be true
66
60
  fails "Kernel#clone replaces a singleton object's metaclass with a new copy with the same superclass" # NoMethodError: undefined method `singleton_methods' for #<#<Class:0x2df8e>:0x2df90>
67
61
  fails "Kernel#clone uses the internal allocator and does not call #allocate" # RuntimeError: allocate should not be called
68
62
  fails "Kernel#define_singleton_method when given an UnboundMethod will raise when attempting to define an object's singleton method from another object's singleton method"
69
63
  fails "Kernel#dup uses the internal allocator and does not call #allocate" # RuntimeError: allocate should not be called
70
- fails "Kernel#eval activates refinements from the binding" # NoMethodError: undefined method `refine' for #<Module:0x1ad8>
71
- fails "Kernel#eval activates refinements from the eval scope" # NoMethodError: undefined method `refine' for #<Module:0x20d4>
72
64
  fails "Kernel#eval allows a binding to be captured inside an eval"
73
65
  fails "Kernel#eval allows creating a new class in a binding" # RuntimeError: Evaluation on a Proc#binding is not supported
74
66
  fails "Kernel#eval can be aliased"
@@ -83,7 +75,6 @@ opal_filter "Kernel" do
83
75
  fails "Kernel#eval updates a local in a scope above when modified in a nested block scope"
84
76
  fails "Kernel#eval updates a local in a surrounding block scope"
85
77
  fails "Kernel#eval updates a local in an enclosing scope"
86
- fails "Kernel#eval uses the filename of the binding if none is provided"
87
78
  fails "Kernel#eval uses the same scope for local variables when given the same binding"
88
79
  fails "Kernel#eval with a magic encoding comment allows a magic encoding comment and a frozen_string_literal magic comment on the same line in emacs style" # Opal::SyntaxError: unexpected token $end
89
80
  fails "Kernel#eval with a magic encoding comment allows a magic encoding comment and a subsequent frozen_string_literal magic comment" # Opal::SyntaxError: unexpected token $end
@@ -107,13 +98,9 @@ opal_filter "Kernel" do
107
98
  fails "Kernel#instance_variables immediate values returns the correct array if an instance variable is added"
108
99
  fails "Kernel#is_a? does not take into account `class` method overriding" # TypeError: can't define singleton
109
100
  fails "Kernel#kind_of? does not take into account `class` method overriding" # TypeError: can't define singleton
110
- fails "Kernel#local_variables contains locals as they are added"
111
- fails "Kernel#local_variables includes only unique variable names" # NoMethodError: undefined method `local_variables' for #<MSpecEnv:0x476>
112
101
  fails "Kernel#local_variables is accessible from bindings"
113
- fails "Kernel#local_variables is accessible in eval"
114
102
  fails "Kernel#method can be called even if we only repond_to_missing? method, true"
115
103
  fails "Kernel#method returns a method object if respond_to_missing?(method) is true" # NameError: undefined method `handled_publicly' for class `KernelSpecs::RespondViaMissing'
116
- fails "Kernel#method returns a method object if we repond_to_missing? method"
117
104
  fails "Kernel#method the returned method object if respond_to_missing?(method) calls #method_missing with a Symbol name" # NameError: undefined method `handled_publicly' for class `KernelSpecs::RespondViaMissing'
118
105
  fails "Kernel#method will see an alias of the original method as == when in a derived class"
119
106
  fails "Kernel#methods does not return private singleton methods defined in 'class << self'"
@@ -122,20 +109,18 @@ opal_filter "Kernel" do
122
109
  fails "Kernel#p flushes output if receiver is a File"
123
110
  fails "Kernel#p is not affected by setting $\\, $/ or $,"
124
111
  fails "Kernel#pp lazily loads the 'pp' library and delegates the call to that library" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x4f28>
125
- fails "Kernel#proc uses the implicit block from an enclosing method"
112
+ fails "Kernel#print prints $_ when no arguments are given" # Expected: $stdout: "foo" got: $stdout: ""
126
113
  fails "Kernel#public_method changes the method called for super on a target aliased method"
127
114
  fails "Kernel#public_method raises a NameError if we only repond_to_missing? method, true"
128
115
  fails "Kernel#public_method returns a method object for a valid method"
129
116
  fails "Kernel#public_method returns a method object for a valid singleton method"
130
117
  fails "Kernel#public_method returns a method object if respond_to_missing?(method) is true" # Expected "Done public_method(handled_publicly)" (String) to be an instance of Method
131
- fails "Kernel#public_method returns a method object if we repond_to_missing? method"
132
118
  fails "Kernel#public_method the returned method object if respond_to_missing?(method) calls #method_missing with a Symbol name" # Expected "Done public_method(handled_publicly)" (String) to be an instance of Method
133
119
  fails "Kernel#public_methods returns a list of names without protected accessible methods in the object"
134
120
  fails "Kernel#public_methods when passed false returns a list of public methods in without its ancestors"
135
121
  fails "Kernel#public_methods when passed nil returns a list of public methods in without its ancestors"
136
122
  fails "Kernel#public_send includes `public_send` in the backtrace when passed a single incorrect argument" # Expected TypeError but got: NoMethodError (undefined method `#<Object:0x3da7a>' for #<MSpecEnv:0x3d9f4>)
137
123
  fails "Kernel#public_send includes `public_send` in the backtrace when passed not enough arguments" # Expected "ArgumentError: [MSpecEnv#__send__] wrong number of arguments(0 for -2)".include? "`public_send'" to be truthy but was false
138
- fails "Kernel#public_send raises a TypeError if the method name is not a string or symbol" # NoMethodError: undefined method `' for SendSpecs
139
124
  fails "Kernel#puts delegates to $stdout.puts"
140
125
  fails "Kernel#raise accepts a cause keyword argument that overrides the last exception" # NoMethodError: undefined method `cause' for #<RuntimeError: error>
141
126
  fails "Kernel#raise accepts a cause keyword argument that sets the cause" # NoMethodError: undefined method `cause' for #<RuntimeError: error>
@@ -145,8 +130,6 @@ opal_filter "Kernel" do
145
130
  fails "Kernel#respond_to? throws a type error if argument can't be coerced into a Symbol"
146
131
  fails "Kernel#respond_to_missing? causes #respond_to? to return false if called and returning nil"
147
132
  fails "Kernel#respond_to_missing? causes #respond_to? to return true if called and not returning false"
148
- fails "Kernel#send raises a TypeError if the method name is not a string or symbol" # NoMethodError: undefined method `' for SendSpecs
149
- fails "Kernel#singleton_class raises TypeError for Fixnum"
150
133
  fails "Kernel#singleton_class raises TypeError for Integer" # Expected TypeError but no exception was raised (#<Class:#<Number:0xf7>> was returned)
151
134
  fails "Kernel#singleton_class raises TypeError for Symbol"
152
135
  fails "Kernel#singleton_method find a method defined on the singleton class" # NoMethodError: undefined method `singleton_method' for #<Object:0x39d20>
@@ -171,9 +154,6 @@ opal_filter "Kernel" do
171
154
  fails "Kernel#singleton_methods when not passed an argument returns the names of singleton methods for an object extended with a module including a module" # NoMethodError: undefined method `singleton_methods' for #<MockObject:0x104da>
172
155
  fails "Kernel#singleton_methods when not passed an argument returns the names of singleton methods for an object extended with a module" # NoMethodError: undefined method `singleton_methods' for #<MockObject:0x104e2>
173
156
  fails "Kernel#singleton_methods when not passed an argument returns the names of singleton methods for an object extended with two modules" # NoMethodError: undefined method `singleton_methods' for #<MockObject:0x104de>
174
- fails "Kernel#singleton_methods when not passed an argument returns the names of singleton methods for an object extented with a module including a module"
175
- fails "Kernel#singleton_methods when not passed an argument returns the names of singleton methods for an object extented with a module"
176
- fails "Kernel#singleton_methods when not passed an argument returns the names of singleton methods for an object extented with two modules"
177
157
  fails "Kernel#singleton_methods when not passed an argument returns the names of singleton methods for an object"
178
158
  fails "Kernel#singleton_methods when passed false does not return any included methods for a class including a module"
179
159
  fails "Kernel#singleton_methods when passed false does not return any included methods for a module including a module"
@@ -184,8 +164,6 @@ opal_filter "Kernel" do
184
164
  fails "Kernel#singleton_methods when passed false returns an empty Array for an object extended with a module including a module"
185
165
  fails "Kernel#singleton_methods when passed false returns an empty Array for an object extended with a module" # NoMethodError: undefined method `singleton_methods' for #<MockObject:0x104fa>
186
166
  fails "Kernel#singleton_methods when passed false returns an empty Array for an object extended with two modules" # NoMethodError: undefined method `singleton_methods' for #<MockObject:0x104f6>
187
- fails "Kernel#singleton_methods when passed false returns an empty Array for an object extented with a module"
188
- fails "Kernel#singleton_methods when passed false returns an empty Array for an object extented with two modules"
189
167
  fails "Kernel#singleton_methods when passed false returns an empty Array for an object with no singleton methods"
190
168
  fails "Kernel#singleton_methods when passed false returns the names of class methods for a class"
191
169
  fails "Kernel#singleton_methods when passed false returns the names of module methods for a module"
@@ -209,9 +187,6 @@ opal_filter "Kernel" do
209
187
  fails "Kernel#singleton_methods when passed true returns the names of singleton methods for an object extended with a module including a module" # NoMethodError: undefined method `singleton_methods' for #<MockObject:0x104f2>
210
188
  fails "Kernel#singleton_methods when passed true returns the names of singleton methods for an object extended with a module" # NoMethodError: undefined method `singleton_methods' for #<MockObject:0x104ee>
211
189
  fails "Kernel#singleton_methods when passed true returns the names of singleton methods for an object extended with two modules" # NoMethodError: undefined method `singleton_methods' for #<MockObject:0x104ea>
212
- fails "Kernel#singleton_methods when passed true returns the names of singleton methods for an object extented with a module including a module"
213
- fails "Kernel#singleton_methods when passed true returns the names of singleton methods for an object extented with a module"
214
- fails "Kernel#singleton_methods when passed true returns the names of singleton methods for an object extented with two modules"
215
190
  fails "Kernel#singleton_methods when passed true returns the names of singleton methods for an object"
216
191
  fails "Kernel#sleep accepts any Object that reponds to divmod" # TypeError: can't convert Object into time interval
217
192
  fails "Kernel#sprintf can produce a string with invalid encoding" # Expected true to be false
@@ -254,8 +229,6 @@ opal_filter "Kernel" do
254
229
  fails "Kernel#sprintf precision string formats determines the maximum number of characters to be copied from the string" # Expected "1" to equal "["
255
230
  fails "Kernel#sprintf raises Encoding::CompatibilityError if both encodings are ASCII compatible and there ano not ASCII characters" # ArgumentError: unknown encoding name - windows-1252
256
231
  fails "Kernel#sprintf width specifies the minimum number of characters that will be written to the result" # Expected " 1.095200e+02" to equal " 1.095200e+02"
257
- fails "Kernel#sprintf with format string that contains %<> sections raises ArgumentError if missing second named argument" # KeyError: key not found: "foo"
258
- fails "Kernel#then returns a sized Enumerator when no block given" # NoMethodError: undefined method `then' for #<Object:0x22882>
259
232
  fails "Kernel#warn :uplevel keyword argument converts first arg using to_s" # Expected: $stderr: /core\/kernel\/fixtures\/classes.rb:441: warning: false/ got: $stderr: "ruby/core/kernel/fixtures/classes.rb:441:7:in `warn': warning: false\n"
260
233
  fails "Kernel#warn :uplevel keyword argument converts value to Integer" # TypeError: no implicit conversion of Number into Integer
261
234
  fails "Kernel#warn :uplevel keyword argument prepends a message with specified line from the backtrace" # Expected: $stderr: /core\/kernel\/fixtures\/classes.rb:441: warning: foo/ got: $stderr: "ruby/core/kernel/fixtures/classes.rb:441:7:in `warn': warning: foo\n"
@@ -267,7 +240,6 @@ opal_filter "Kernel" do
267
240
  fails "Kernel#warn avoids recursion if Warning#warn is redefined and calls super" # NoMethodError: undefined method `insert' for "rubyexe.rb"
268
241
  fails "Kernel#warn does not call Warning.warn if self is the Warning module" # NoMethodError: undefined method `insert' for "rubyexe.rb"
269
242
  fails "Kernel#warn writes each array element on a line when passes an array" # Expected: $stderr: "line 1\nline 2\n" got: $stderr: "[\"line 1\", \"li
270
- fails "Kernel#yield_self returns a sized Enumerator when no block given" # Requires Enumerator#peek
271
243
  fails "Kernel.Complex() when passed Numerics n1 and n2 and at least one responds to #real? with false returns n1 + n2 * Complex(0, 1)"
272
244
  fails "Kernel.Complex() when passed [Complex, Complex] returns a new Complex number based on the two given numbers"
273
245
  fails "Kernel.Complex() when passed [Complex] returns the passed Complex number"
@@ -275,7 +247,6 @@ opal_filter "Kernel" do
275
247
  fails "Kernel.Complex() when passed a non-Numeric second argument raises TypeError"
276
248
  fails "Kernel.Complex() when passed a single non-Numeric coerces the passed argument using #to_c"
277
249
  fails "Kernel.Complex() when passed an Object which responds to #to_c returns the passed argument" # Expected (#<Object:0x332c0>+0i) to equal (0+1i)
278
- fails "Kernel.Complex() when passed an Objectc which responds to #to_c returns the passed argument" # Expected (#<Object:0x46fa6>+0i) to equal (0+1i)
279
250
  fails "Kernel.Complex() when passed exception: false and [Numeric] returns a complex number" # Expected #<Complex>(#pretty_inspect raised #<NoMethodError: undefined method `positive?' for {"exception"=>false}>) == (123+0i) to be truthy but was false
280
251
  fails "Kernel.Complex() when passed exception: false and [anything, non-Numeric] argument swallows an error" # ArgumentError: [MSpecEnv#Complex] wrong number of arguments(3 for -2)
281
252
  fails "Kernel.Complex() when passed exception: false and [non-Numeric, Numeric] argument throws a TypeError" # Expected TypeError (not a real) but got: ArgumentError ([MSpecEnv#Complex] wrong number of arguments(3 for -2))
@@ -345,7 +316,6 @@ opal_filter "Kernel" do
345
316
  fails "Kernel.global_variables finds subset starting with std"
346
317
  fails "Kernel.lambda does not create lambda-style Procs when captured with #method" # Expected true to be false
347
318
  fails "Kernel.lambda raises an ArgumentError when no block is given"
348
- fails "Kernel.lambda returned the passed Proc if given an existing Proc" # Expected true to be false
349
319
  fails "Kernel.lambda returns from the lambda itself, not the creation site of the lambda"
350
320
  fails "Kernel.lambda returns the passed Proc if given an existing Proc through super" # Expected true to be false
351
321
  fails "Kernel.lambda returns the passed Proc if given an existing Proc" # Expected true to be false
@@ -400,4 +370,5 @@ opal_filter "Kernel" do
400
370
  fails "Kernel.sprintf returns a String in the same encoding as the format String if compatible" # NameError: uninitialized constant Encoding::KOI8_U
401
371
  fails "Kernel.sprintf width specifies the minimum number of characters that will be written to the result" # Expected " 1.095200e+02" to equal " 1.095200e+02"
402
372
  fails "Kernel.srand returns the previous seed value on the first call" # NoMethodError: undefined method `insert' for "rubyexe.rb"
373
+ fails_badly "Kernel#autoload registers a file to load the first time the named constant is accessed" # NoMethodError: undefined method `autoload?' for #<MSpecEnv:0x5b168>
403
374
  end