opal 1.0.3 → 1.1.1.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (408) hide show
  1. checksums.yaml +4 -4
  2. data/.codeclimate.yml +13 -12
  3. data/.gitattributes +1 -1
  4. data/.github/FUNDING.yml +1 -0
  5. data/.github/workflows/build.yml +90 -0
  6. data/.jshintrc +1 -1
  7. data/.overcommit.yml +35 -0
  8. data/.rubocop.yml +44 -7
  9. data/{.rubocop_todo.yml → .rubocop/todo.yml} +4 -5
  10. data/CHANGELOG.md +152 -1
  11. data/Gemfile +2 -3
  12. data/HACKING.md +2 -9
  13. data/LICENSE +1 -1
  14. data/README.md +21 -18
  15. data/UNRELEASED.md +4 -2
  16. data/benchmark-ips/bm_array_pop_1.rb +8 -0
  17. data/benchmark-ips/bm_array_shift.rb +7 -0
  18. data/benchmark-ips/bm_js_symbols_vs_strings.rb +7 -2
  19. data/benchmark-ips/class_shovel_vs_singleton_class.rb +16 -0
  20. data/bin/build-browser-source-map-support +4 -0
  21. data/bin/format-filters +54 -0
  22. data/bin/git-submodule-fast-install +49 -0
  23. data/bin/remove-filters +39 -0
  24. data/bin/setup +4 -0
  25. data/bin/yarn +11 -0
  26. data/docs/releasing.md +18 -0
  27. data/docs/roda-sprockets.md +86 -0
  28. data/docs/sinatra.md +5 -12
  29. data/examples/rack/Gemfile +1 -0
  30. data/examples/rack/app/application.rb +3 -0
  31. data/examples/rack/config.ru +5 -4
  32. data/exe/opal-repl +2 -83
  33. data/lib/opal/ast/builder.rb +1 -1
  34. data/lib/opal/builder.rb +2 -10
  35. data/lib/opal/builder_processors.rb +1 -1
  36. data/lib/opal/cli.rb +4 -1
  37. data/lib/opal/cli_options.rb +11 -3
  38. data/lib/opal/cli_runners.rb +27 -37
  39. data/lib/opal/cli_runners/applescript.rb +5 -44
  40. data/lib/opal/cli_runners/chrome.js +7 -35
  41. data/lib/opal/cli_runners/chrome.rb +75 -17
  42. data/lib/opal/cli_runners/compiler.rb +17 -0
  43. data/lib/opal/cli_runners/nashorn.rb +9 -43
  44. data/lib/opal/cli_runners/nodejs.rb +18 -47
  45. data/lib/opal/cli_runners/server.rb +18 -6
  46. data/lib/opal/cli_runners/source-map-support-browser.js +6449 -0
  47. data/lib/opal/cli_runners/source-map-support-node.js +3704 -0
  48. data/lib/opal/cli_runners/source-map-support.js +639 -0
  49. data/lib/opal/cli_runners/system_runner.rb +45 -0
  50. data/lib/opal/compiler.rb +57 -29
  51. data/lib/opal/config.rb +0 -5
  52. data/lib/opal/erb.rb +1 -1
  53. data/lib/opal/magic_comments.rb +34 -0
  54. data/lib/opal/nodes/args/arity_check.rb +2 -1
  55. data/lib/opal/nodes/base.rb +1 -1
  56. data/lib/opal/nodes/call.rb +1 -4
  57. data/lib/opal/nodes/def.rb +2 -0
  58. data/lib/opal/nodes/iter.rb +1 -1
  59. data/lib/opal/nodes/literal.rb +19 -14
  60. data/lib/opal/nodes/logic.rb +5 -80
  61. data/lib/opal/nodes/masgn.rb +2 -0
  62. data/lib/opal/nodes/rescue.rb +1 -1
  63. data/lib/opal/nodes/super.rb +24 -10
  64. data/lib/opal/nodes/top.rb +5 -4
  65. data/lib/opal/parser/with_c_lexer.rb +2 -1
  66. data/lib/opal/parser/with_ruby_lexer.rb +1 -1
  67. data/lib/opal/path_reader.rb +2 -2
  68. data/lib/opal/paths.rb +8 -5
  69. data/lib/opal/repl.rb +103 -0
  70. data/lib/opal/rewriter.rb +4 -0
  71. data/lib/opal/rewriters/for_rewriter.rb +1 -1
  72. data/lib/opal/rewriters/js_reserved_words.rb +7 -7
  73. data/lib/opal/rewriters/numblocks.rb +31 -0
  74. data/lib/opal/rewriters/returnable_logic.rb +33 -0
  75. data/lib/opal/util.rb +11 -48
  76. data/lib/opal/version.rb +1 -1
  77. data/opal.gemspec +26 -26
  78. data/opal/corelib/array.rb +160 -118
  79. data/opal/corelib/array/pack.rb +5 -3
  80. data/opal/corelib/basic_object.rb +4 -4
  81. data/opal/corelib/class.rb +2 -1
  82. data/opal/corelib/comparable.rb +49 -31
  83. data/opal/corelib/constants.rb +5 -5
  84. data/opal/corelib/enumerable.rb +108 -46
  85. data/opal/corelib/enumerator.rb +27 -12
  86. data/opal/corelib/file.rb +3 -1
  87. data/opal/corelib/hash.rb +6 -1
  88. data/opal/corelib/helpers.rb +8 -28
  89. data/opal/corelib/io.rb +12 -7
  90. data/opal/corelib/kernel.rb +45 -14
  91. data/opal/corelib/kernel/format.rb +3 -1
  92. data/opal/corelib/math.rb +8 -6
  93. data/opal/corelib/method.rb +8 -0
  94. data/opal/corelib/module.rb +17 -2
  95. data/opal/corelib/number.rb +3 -12
  96. data/opal/corelib/proc.rb +16 -0
  97. data/opal/corelib/random/mersenne_twister.rb +147 -0
  98. data/opal/corelib/range.rb +3 -13
  99. data/opal/corelib/regexp.rb +10 -6
  100. data/opal/corelib/runtime.js +208 -81
  101. data/opal/corelib/string.rb +55 -49
  102. data/opal/corelib/string/encoding.rb +109 -32
  103. data/opal/corelib/string/unpack.rb +2 -17
  104. data/opal/corelib/struct.rb +14 -1
  105. data/opal/corelib/time.rb +4 -0
  106. data/opal/opal.rb +1 -1
  107. data/opal/opal/mini.rb +1 -1
  108. data/package.json +16 -0
  109. data/spec/README.md +10 -0
  110. data/spec/filters/bugs/array.rb +76 -0
  111. data/spec/filters/bugs/base64.rb +10 -0
  112. data/spec/filters/bugs/basicobject.rb +12 -0
  113. data/spec/filters/bugs/bigdecimal.rb +248 -0
  114. data/spec/filters/bugs/class.rb +12 -0
  115. data/spec/filters/bugs/complex.rb +7 -0
  116. data/spec/filters/bugs/date.rb +104 -0
  117. data/spec/filters/bugs/encoding.rb +259 -0
  118. data/spec/filters/bugs/enumerable.rb +26 -0
  119. data/spec/filters/bugs/enumerator.rb +48 -0
  120. data/spec/filters/bugs/exception.rb +120 -0
  121. data/spec/filters/bugs/file.rb +48 -0
  122. data/spec/filters/bugs/float.rb +74 -0
  123. data/spec/filters/bugs/hash.rb +60 -0
  124. data/spec/filters/bugs/integer.rb +78 -0
  125. data/spec/filters/bugs/io.rb +9 -0
  126. data/spec/filters/bugs/kernel.rb +401 -0
  127. data/spec/filters/bugs/language.rb +451 -0
  128. data/spec/filters/bugs/marshal.rb +50 -0
  129. data/spec/filters/bugs/math.rb +4 -0
  130. data/spec/filters/bugs/method.rb +79 -0
  131. data/spec/filters/bugs/module.rb +281 -0
  132. data/spec/filters/bugs/nilclass.rb +4 -0
  133. data/spec/filters/bugs/numeric.rb +27 -0
  134. data/spec/filters/bugs/openstruct.rb +8 -0
  135. data/spec/filters/bugs/pack_unpack.rb +138 -0
  136. data/spec/filters/bugs/pathname.rb +9 -0
  137. data/spec/filters/bugs/proc.rb +80 -0
  138. data/spec/filters/bugs/random.rb +20 -0
  139. data/spec/filters/bugs/range.rb +139 -0
  140. data/spec/filters/bugs/rational.rb +12 -0
  141. data/spec/filters/bugs/regexp.rb +91 -0
  142. data/spec/filters/bugs/set.rb +51 -0
  143. data/spec/filters/bugs/singleton.rb +7 -0
  144. data/spec/filters/bugs/string.rb +341 -0
  145. data/spec/filters/bugs/stringscanner.rb +78 -0
  146. data/spec/filters/bugs/struct.rb +26 -0
  147. data/spec/filters/bugs/symbol.rb +7 -0
  148. data/spec/filters/bugs/time.rb +109 -0
  149. data/spec/filters/bugs/unboundmethod.rb +33 -0
  150. data/spec/filters/bugs/warnings.rb +30 -0
  151. data/spec/filters/unsupported/array.rb +168 -0
  152. data/spec/filters/unsupported/basicobject.rb +15 -0
  153. data/spec/filters/unsupported/bignum.rb +55 -0
  154. data/spec/filters/unsupported/class.rb +5 -0
  155. data/spec/filters/unsupported/delegator.rb +6 -0
  156. data/spec/filters/unsupported/enumerable.rb +12 -0
  157. data/spec/filters/unsupported/enumerator.rb +14 -0
  158. data/spec/filters/unsupported/file.rb +4 -0
  159. data/spec/filters/unsupported/fixnum.rb +15 -0
  160. data/spec/filters/unsupported/float.rb +47 -0
  161. data/spec/filters/unsupported/freeze.rb +259 -0
  162. data/spec/filters/unsupported/hash.rb +44 -0
  163. data/spec/filters/unsupported/integer.rb +101 -0
  164. data/spec/filters/unsupported/kernel.rb +35 -0
  165. data/spec/filters/unsupported/language.rb +25 -0
  166. data/spec/filters/unsupported/marshal.rb +44 -0
  167. data/spec/filters/unsupported/matchdata.rb +63 -0
  168. data/spec/filters/unsupported/math.rb +4 -0
  169. data/spec/filters/unsupported/pathname.rb +4 -0
  170. data/spec/filters/unsupported/privacy.rb +287 -0
  171. data/spec/filters/unsupported/proc.rb +4 -0
  172. data/spec/filters/unsupported/random.rb +5 -0
  173. data/spec/filters/unsupported/range.rb +8 -0
  174. data/spec/filters/unsupported/regexp.rb +70 -0
  175. data/spec/filters/unsupported/set.rb +5 -0
  176. data/spec/filters/unsupported/singleton.rb +7 -0
  177. data/spec/filters/unsupported/string.rb +687 -0
  178. data/spec/filters/unsupported/struct.rb +7 -0
  179. data/spec/filters/unsupported/symbol.rb +21 -0
  180. data/spec/filters/unsupported/taint.rb +162 -0
  181. data/spec/filters/unsupported/thread.rb +10 -0
  182. data/spec/filters/unsupported/time.rb +204 -0
  183. data/spec/filters/unsupported/usage_of_files.rb +262 -0
  184. data/spec/lib/builder_processors_spec.rb +44 -0
  185. data/spec/lib/builder_spec.rb +133 -0
  186. data/spec/lib/cli_runners/server_spec.rb +25 -0
  187. data/spec/lib/cli_runners_spec.rb +16 -0
  188. data/spec/lib/cli_spec.rb +256 -0
  189. data/spec/lib/compiler_spec.rb +693 -0
  190. data/spec/lib/config_spec.rb +112 -0
  191. data/spec/lib/dependency_resolver_spec.rb +43 -0
  192. data/spec/lib/deprecations_spec.rb +17 -0
  193. data/spec/lib/fixtures/complex_sprockets.js.rb.erb +4 -0
  194. data/spec/lib/fixtures/file_with_directives.js +2 -0
  195. data/spec/lib/fixtures/jst_file.js.jst +1 -0
  196. data/spec/lib/fixtures/no_requires.rb +1 -0
  197. data/spec/lib/fixtures/opal_file.rb +2 -0
  198. data/spec/lib/fixtures/require_tree_test.rb +3 -0
  199. data/spec/lib/fixtures/required_file.js +1 -0
  200. data/spec/lib/fixtures/required_tree_test/required_file1.rb +1 -0
  201. data/spec/lib/fixtures/required_tree_test/required_file2.rb +1 -0
  202. data/spec/lib/fixtures/requires.rb +7 -0
  203. data/spec/lib/fixtures/source_location_test.rb +7 -0
  204. data/spec/lib/fixtures/source_map.rb +1 -0
  205. data/spec/lib/fixtures/source_map/subfolder/other_file.rb +1 -0
  206. data/spec/lib/fixtures/sprockets_file.js.rb +3 -0
  207. data/spec/lib/fixtures/sprockets_require_tree_test.rb +3 -0
  208. data/spec/lib/path_reader_spec.rb +47 -0
  209. data/spec/lib/paths_spec.rb +18 -0
  210. data/spec/lib/repl_spec.rb +28 -0
  211. data/spec/lib/rewriters/base_spec.rb +68 -0
  212. data/spec/lib/rewriters/binary_operator_assignment_spec.rb +153 -0
  213. data/spec/lib/rewriters/block_to_iter_spec.rb +28 -0
  214. data/spec/lib/rewriters/dot_js_syntax_spec.rb +108 -0
  215. data/spec/lib/rewriters/explicit_writer_return_spec.rb +186 -0
  216. data/spec/lib/rewriters/for_rewriter_spec.rb +92 -0
  217. data/spec/lib/rewriters/hashes/key_duplicates_rewriter_spec.rb +47 -0
  218. data/spec/lib/rewriters/js_reserved_words_spec.rb +119 -0
  219. data/spec/lib/rewriters/logical_operator_assignment_spec.rb +202 -0
  220. data/spec/lib/rewriters/opal_engine_check_spec.rb +84 -0
  221. data/spec/lib/rewriters/returnable_logic_spec.rb +52 -0
  222. data/spec/lib/rewriters/rubyspec/filters_rewriter_spec.rb +59 -0
  223. data/spec/lib/simple_server_spec.rb +56 -0
  224. data/spec/lib/source_map/file_spec.rb +67 -0
  225. data/spec/lib/source_map/index_spec.rb +80 -0
  226. data/spec/lib/spec_helper.rb +105 -0
  227. data/spec/mspec-opal/formatters.rb +197 -0
  228. data/spec/mspec-opal/runner.rb +172 -0
  229. data/spec/opal/compiler/irb_spec.rb +44 -0
  230. data/spec/opal/compiler/unicode_spec.rb +10 -0
  231. data/spec/opal/core/array/dup_spec.rb +23 -0
  232. data/spec/opal/core/array/intersection_spec.rb +38 -0
  233. data/spec/opal/core/array/minus_spec.rb +38 -0
  234. data/spec/opal/core/array/union_spec.rb +38 -0
  235. data/spec/opal/core/array/uniq_spec.rb +49 -0
  236. data/spec/opal/core/class/inherited_spec.rb +18 -0
  237. data/spec/opal/core/enumerable/all_break_spec.rb +5 -0
  238. data/spec/opal/core/enumerable/any_break_spec.rb +5 -0
  239. data/spec/opal/core/enumerable/collect_break_spec.rb +13 -0
  240. data/spec/opal/core/enumerable/count_break_spec.rb +5 -0
  241. data/spec/opal/core/enumerable/detect_break_spec.rb +5 -0
  242. data/spec/opal/core/enumerable/drop_while_break_spec.rb +5 -0
  243. data/spec/opal/core/enumerable/each_slice_break_spec.rb +6 -0
  244. data/spec/opal/core/enumerable/each_with_index_break_spec.rb +5 -0
  245. data/spec/opal/core/enumerable/each_with_object_break_spec.rb +5 -0
  246. data/spec/opal/core/enumerable/find_all_break_spec.rb +5 -0
  247. data/spec/opal/core/enumerable/find_index_break_spec.rb +5 -0
  248. data/spec/opal/core/enumerable/grep_break_spec.rb +5 -0
  249. data/spec/opal/core/enumerable/max_break_spec.rb +5 -0
  250. data/spec/opal/core/enumerable/max_by_break_spec.rb +5 -0
  251. data/spec/opal/core/enumerable/min_break_spec.rb +5 -0
  252. data/spec/opal/core/enumerable/min_by_break_spec.rb +5 -0
  253. data/spec/opal/core/enumerable/none_break_spec.rb +5 -0
  254. data/spec/opal/core/enumerable/one_break_spec.rb +5 -0
  255. data/spec/opal/core/enumerable/reduce_break_spec.rb +5 -0
  256. data/spec/opal/core/enumerable/take_while_break_spec.rb +5 -0
  257. data/spec/opal/core/enumerator/with_index_spec.rb +6 -0
  258. data/spec/opal/core/exception_spec.rb +8 -0
  259. data/spec/opal/core/fixtures/require_tree_files/file 1.rb +1 -0
  260. data/spec/opal/core/fixtures/require_tree_files/file 2.rb +1 -0
  261. data/spec/opal/core/fixtures/require_tree_files/file 3.rb +1 -0
  262. data/spec/opal/core/fixtures/require_tree_files/file 4.rb +1 -0
  263. data/spec/opal/core/fixtures/require_tree_files/file 5.rb +1 -0
  264. data/spec/opal/core/fixtures/require_tree_files/nested/nested 1.rb +1 -0
  265. data/spec/opal/core/fixtures/require_tree_files/nested/nested 2.rb +1 -0
  266. data/spec/opal/core/fixtures/require_tree_files/other/other 1.rb +1 -0
  267. data/spec/opal/core/fixtures/require_tree_with_dot/file 1.rb +1 -0
  268. data/spec/opal/core/fixtures/require_tree_with_dot/file 2.rb +1 -0
  269. data/spec/opal/core/fixtures/require_tree_with_dot/file 3.rb +1 -0
  270. data/spec/opal/core/fixtures/require_tree_with_dot/index.rb +3 -0
  271. data/spec/opal/core/hash/internals_spec.rb +339 -0
  272. data/spec/opal/core/helpers_spec.rb +14 -0
  273. data/spec/opal/core/iterable_props_spec.rb +53 -0
  274. data/spec/opal/core/kernel/at_exit_spec.rb +70 -0
  275. data/spec/opal/core/kernel/freeze_spec.rb +15 -0
  276. data/spec/opal/core/kernel/instance_variables_spec.rb +110 -0
  277. data/spec/opal/core/kernel/methods_spec.rb +25 -0
  278. data/spec/opal/core/kernel/public_methods_spec.rb +25 -0
  279. data/spec/opal/core/kernel/require_tree_spec.rb +18 -0
  280. data/spec/opal/core/kernel/respond_to_spec.rb +15 -0
  281. data/spec/opal/core/language/DATA/characters_support_spec.rb +9 -0
  282. data/spec/opal/core/language/DATA/empty___END___spec.rb +7 -0
  283. data/spec/opal/core/language/DATA/multiple___END___spec.rb +10 -0
  284. data/spec/opal/core/language/arguments/mlhs_arg_spec.rb +18 -0
  285. data/spec/opal/core/language/keyword_arguments_spec.rb +9 -0
  286. data/spec/opal/core/language/numblocks_spec.rb +16 -0
  287. data/spec/opal/core/language/safe_navigator_spec.rb +7 -0
  288. data/spec/opal/core/language/while_spec.rb +31 -0
  289. data/spec/opal/core/language_spec.rb +29 -0
  290. data/spec/opal/core/marshal/dump_spec.rb +81 -0
  291. data/spec/opal/core/marshal/load_spec.rb +13 -0
  292. data/spec/opal/core/module_spec.rb +27 -0
  293. data/spec/opal/core/object_id_spec.rb +56 -0
  294. data/spec/opal/core/regexp/interpolation_spec.rb +40 -0
  295. data/spec/opal/core/regexp/match_spec.rb +78 -0
  296. data/spec/opal/core/runtime/bridged_classes_spec.rb +123 -0
  297. data/spec/opal/core/runtime/constants_spec.rb +16 -0
  298. data/spec/opal/core/runtime/eval_spec.rb +5 -0
  299. data/spec/opal/core/runtime/exit_spec.rb +29 -0
  300. data/spec/opal/core/runtime/is_a_spec.rb +48 -0
  301. data/spec/opal/core/runtime/loaded_spec.rb +20 -0
  302. data/spec/opal/core/runtime/main_methods_spec.rb +39 -0
  303. data/spec/opal/core/runtime/method_missing_spec.rb +68 -0
  304. data/spec/opal/core/runtime/rescue_spec.rb +37 -0
  305. data/spec/opal/core/runtime/string_spec.rb +25 -0
  306. data/spec/opal/core/runtime/truthy_spec.rb +61 -0
  307. data/spec/opal/core/runtime_spec.rb +58 -0
  308. data/spec/opal/core/string/each_byte_spec.rb +19 -0
  309. data/spec/opal/core/string/gsub_spec.rb +35 -0
  310. data/spec/opal/core/string/to_sym_spec.rb +9 -0
  311. data/spec/opal/core/string_spec.rb +28 -0
  312. data/spec/opal/core/struct/dup_spec.rb +11 -0
  313. data/spec/opal/core/time_spec.rb +68 -0
  314. data/spec/opal/stdlib/erb/erb_spec.rb +30 -0
  315. data/spec/opal/stdlib/erb/inline_block.opalerb +3 -0
  316. data/spec/opal/stdlib/erb/quoted.opalerb +1 -0
  317. data/spec/opal/stdlib/erb/simple.opalerb +1 -0
  318. data/spec/opal/stdlib/js_spec.rb +72 -0
  319. data/spec/opal/stdlib/json/ext_spec.rb +55 -0
  320. data/spec/opal/stdlib/json/parse_spec.rb +37 -0
  321. data/spec/opal/stdlib/logger/logger_spec.rb +308 -0
  322. data/spec/opal/stdlib/native/alias_native_spec.rb +27 -0
  323. data/spec/opal/stdlib/native/array_spec.rb +11 -0
  324. data/spec/opal/stdlib/native/date_spec.rb +12 -0
  325. data/spec/opal/stdlib/native/deprecated_include_spec.rb +8 -0
  326. data/spec/opal/stdlib/native/each_spec.rb +13 -0
  327. data/spec/opal/stdlib/native/element_reference_spec.rb +16 -0
  328. data/spec/opal/stdlib/native/exposure_spec.rb +33 -0
  329. data/spec/opal/stdlib/native/ext_spec.rb +19 -0
  330. data/spec/opal/stdlib/native/hash_spec.rb +67 -0
  331. data/spec/opal/stdlib/native/initialize_spec.rb +17 -0
  332. data/spec/opal/stdlib/native/method_missing_spec.rb +51 -0
  333. data/spec/opal/stdlib/native/native_alias_spec.rb +26 -0
  334. data/spec/opal/stdlib/native/native_class_spec.rb +18 -0
  335. data/spec/opal/stdlib/native/native_module_spec.rb +13 -0
  336. data/spec/opal/stdlib/native/native_reader_spec.rb +22 -0
  337. data/spec/opal/stdlib/native/native_writer_spec.rb +30 -0
  338. data/spec/opal/stdlib/native/new_spec.rb +92 -0
  339. data/spec/opal/stdlib/native/struct_spec.rb +12 -0
  340. data/spec/opal/stdlib/pp_spec.rb +5 -0
  341. data/spec/opal/stdlib/promise/always_spec.rb +49 -0
  342. data/spec/opal/stdlib/promise/error_spec.rb +15 -0
  343. data/spec/opal/stdlib/promise/rescue_spec.rb +53 -0
  344. data/spec/opal/stdlib/promise/then_spec.rb +79 -0
  345. data/spec/opal/stdlib/promise/trace_spec.rb +51 -0
  346. data/spec/opal/stdlib/promise/value_spec.rb +15 -0
  347. data/spec/opal/stdlib/promise/when_spec.rb +34 -0
  348. data/spec/opal/stdlib/source_map_spec.rb +8 -0
  349. data/spec/opal/stdlib/strscan/scan_spec.rb +11 -0
  350. data/spec/opal/stdlib/template/paths_spec.rb +10 -0
  351. data/spec/opal/stdlib/thread/mutex_spec.rb +40 -0
  352. data/spec/opal/stdlib/thread/thread_queue_spec.rb +32 -0
  353. data/spec/opal/stdlib/thread/thread_spec.rb +60 -0
  354. data/spec/ruby_specs +183 -0
  355. data/spec/spec_helper.rb +31 -0
  356. data/spec/support/guard_platform.rb +4 -0
  357. data/spec/support/match_helpers.rb +57 -0
  358. data/spec/support/mspec_rspec_adapter.rb +33 -0
  359. data/spec/support/rewriters_helper.rb +54 -0
  360. data/spec/support/source_map_helper.rb +190 -0
  361. data/stdlib/base64.rb +2 -2
  362. data/stdlib/bigdecimal.rb +15 -3
  363. data/stdlib/bigdecimal/bignumber.js.rb +1 -1
  364. data/stdlib/bigdecimal/util.rb +148 -0
  365. data/stdlib/delegate.rb +8 -0
  366. data/stdlib/nodejs/fileutils.rb +1 -1
  367. data/stdlib/nodejs/kernel.rb +0 -13
  368. data/stdlib/nodejs/stacktrace.rb +4 -179
  369. data/stdlib/ostruct.rb +5 -0
  370. data/stdlib/pp.rb +586 -19
  371. data/stdlib/prettyprint.rb +556 -0
  372. data/stdlib/rbconfig/sizeof.rb +2 -0
  373. data/stdlib/securerandom.rb +32 -0
  374. data/stdlib/set.rb +36 -0
  375. data/stdlib/strscan.rb +15 -0
  376. data/tasks/benchmarking.rake +1 -1
  377. data/tasks/linting.rake +3 -5
  378. data/tasks/releasing.rake +2 -5
  379. data/tasks/testing.rake +16 -11
  380. data/tasks/testing/mspec_special_calls.rb +1 -19
  381. data/test/nodejs/fixtures/cat.png +0 -0
  382. data/test/nodejs/fixtures/hello.rb +1 -0
  383. data/test/nodejs/fixtures/iso88591.txt +1 -0
  384. data/test/nodejs/fixtures/utf8.txt +1 -0
  385. data/test/nodejs/fixtures/win1258.txt +1 -0
  386. data/test/nodejs/test_dir.rb +39 -0
  387. data/test/nodejs/test_env.rb +62 -0
  388. data/test/nodejs/test_error.rb +29 -0
  389. data/test/nodejs/test_file.rb +206 -0
  390. data/test/nodejs/test_file_encoding.rb +20 -0
  391. data/test/nodejs/test_io.rb +18 -0
  392. data/test/nodejs/test_opal_builder.rb +12 -0
  393. data/test/nodejs/test_pathname.rb +16 -0
  394. data/test/opal/cat.png +0 -0
  395. data/test/opal/http_server.rb +52 -0
  396. data/test/opal/test_base64.rb +115 -0
  397. data/test/opal/test_keyword.rb +590 -0
  398. data/test/opal/test_matrix.rb +661 -0
  399. data/test/opal/test_openuri.rb +53 -0
  400. data/test/opal/unsupported_and_bugs.rb +39 -0
  401. data/yarn.lock +1355 -0
  402. metadata +905 -40
  403. data/.travis.yml +0 -109
  404. data/appveyor.yml +0 -35
  405. data/lib/opal/nodes/runtime_helpers.rb +0 -51
  406. data/opal/corelib/random/MersenneTwister.js +0 -137
  407. data/opal/corelib/random/mersenne_twister.js.rb +0 -13
  408. data/stdlib/bigdecimal/kernel.rb +0 -5
@@ -0,0 +1,78 @@
1
+ # NOTE: run bin/format-filters after changing this file
2
+ opal_filter "StringScanner" do
3
+ fails "StringScanner#<< concatenates the given argument to self and returns self"
4
+ fails "StringScanner#<< raises a TypeError if the given argument can't be converted to a String"
5
+ fails "StringScanner#<< when passed a Fixnum doesn't call to_int on the argument"
6
+ fails "StringScanner#<< when passed a Fixnum raises a TypeError"
7
+ fails "StringScanner#<< when passed an Integer doesn't call to_int on the argument" # Expected TypeError but got: NoMethodError (undefined method `<<' for #<StringScanner:0x28c>)
8
+ fails "StringScanner#<< when passed an Integer raises a TypeError" # Expected TypeError but got: NoMethodError (undefined method `<<' for #<StringScanner:0x290>)
9
+ fails "StringScanner#[] raises a IndexError when there's no named capture"
10
+ fails "StringScanner#[] returns named capture"
11
+ fails "StringScanner#clear set the scan pointer to the end of the string and clear matching data."
12
+ fails "StringScanner#clear warns in verbose mode that the method is obsolete"
13
+ fails "StringScanner#concat concatenates the given argument to self and returns self"
14
+ fails "StringScanner#concat raises a TypeError if the given argument can't be converted to a String"
15
+ fails "StringScanner#concat when passed a Fixnum doesn't call to_int on the argument"
16
+ fails "StringScanner#concat when passed a Fixnum raises a TypeError"
17
+ fails "StringScanner#concat when passed an Integer doesn't call to_int on the argument" # Expected TypeError but got: NoMethodError (undefined method `concat' for #<StringScanner:0x362>)
18
+ fails "StringScanner#concat when passed an Integer raises a TypeError" # Expected TypeError but got: NoMethodError (undefined method `concat' for #<StringScanner:0x366>)
19
+ fails "StringScanner#dup copies previous match state"
20
+ fails "StringScanner#empty? returns false if the scan pointer is not at the end of the string" # NoMethodError: undefined method `empty?' for #<StringScanner:0x726>
21
+ fails "StringScanner#empty? returns true if the scan pointer is at the end of the string" # NoMethodError: undefined method `empty?' for #<StringScanner:0x72a>
22
+ fails "StringScanner#empty? warns in verbose mode that the method is obsolete"
23
+ fails "StringScanner#getbyte is not multi-byte character sensitive"
24
+ fails "StringScanner#getbyte returns an instance of String when passed a String subclass"
25
+ fails "StringScanner#getbyte returns nil at the end of the string"
26
+ fails "StringScanner#getbyte scans one byte and returns it"
27
+ fails "StringScanner#getbyte warns in verbose mode that the method is obsolete"
28
+ fails "StringScanner#getch is multi-byte character sensitive"
29
+ fails "StringScanner#initialize converts the argument into a string using #to_str"
30
+ fails "StringScanner#inspect returns a string that represents the StringScanner object"
31
+ fails "StringScanner#matched returns the last matched string"
32
+ fails "StringScanner#matched? returns false if there's no match"
33
+ fails "StringScanner#matched? returns true if the last match was successful"
34
+ fails "StringScanner#peek raises a ArgumentError when the passed argument is negative"
35
+ fails "StringScanner#peek raises a RangeError when the passed argument is a Bignum"
36
+ fails "StringScanner#peek returns at most the specified number of bytes from the current position" # Expected "ét" to equal "é"
37
+ fails "StringScanner#peep raises a ArgumentError when the passed argument is negative"
38
+ fails "StringScanner#peep raises a RangeError when the passed argument is a Bignum"
39
+ fails "StringScanner#peep returns an empty string when the passed argument is zero"
40
+ fails "StringScanner#peep returns an instance of String when passed a String subclass"
41
+ fails "StringScanner#peep returns at most the specified number of bytes from the current position" # NoMethodError: undefined method `peep' for #<StringScanner:0x590>
42
+ fails "StringScanner#peep returns at most the specified number of characters from the current position"
43
+ fails "StringScanner#peep warns in verbose mode that the method is obsolete"
44
+ fails "StringScanner#pointer returns 0 in the reset position"
45
+ fails "StringScanner#pointer returns the length of the string in the terminate position"
46
+ fails "StringScanner#pointer returns the position of the scan pointer"
47
+ fails "StringScanner#pointer= modify the scan pointer"
48
+ fails "StringScanner#pointer= positions from the end if the argument is negative"
49
+ fails "StringScanner#pointer= raises a RangeError if position too far backward"
50
+ fails "StringScanner#pointer= raises a RangeError when the passed argument is out of range"
51
+ fails "StringScanner#pos returns the position of the scan pointer"
52
+ fails "StringScanner#pos= raises a RangeError if position too far backward"
53
+ fails "StringScanner#pos= raises a RangeError when the passed argument is out of range"
54
+ fails "StringScanner#restsize is equivalent to rest.size"
55
+ fails "StringScanner#restsize returns the length of the rest of the string" # NoMethodError: undefined method `restsize' for #<StringScanner:0x4a4>
56
+ fails "StringScanner#restsize warns in verbose mode that the method is obsolete"
57
+ fails "StringScanner#scan raises a TypeError if pattern is a String" # Expected TypeError but no exception was raised (nil was returned)
58
+ fails "StringScanner#scan raises a TypeError if pattern isn't a Regexp nor String" # Expected TypeError but no exception was raised (nil was returned)
59
+ fails "StringScanner#scan raises a TypeError if pattern isn't a Regexp"
60
+ fails "StringScanner#scan treats String as the pattern itself" # Expected nil == "This" to be truthy but was false
61
+ fails "StringScanner#scan with fixed_anchor: true returns the matched string" # ArgumentError: [StringScanner#initialize] wrong number of arguments(2 for 1)
62
+ fails "StringScanner#scan with fixed_anchor: true treats \\A as matching from the beginning of string" # ArgumentError: [StringScanner#initialize] wrong number of arguments(2 for 1)
63
+ fails "StringScanner#scan with fixed_anchor: true treats ^ as matching from the beginning of line" # ArgumentError: [StringScanner#initialize] wrong number of arguments(2 for 1)
64
+ fails "StringScanner#scan_full returns the matched string if the third argument is true and advances the scan pointer if the second argument is true"
65
+ fails "StringScanner#scan_full returns the matched string if the third argument is true"
66
+ fails "StringScanner#scan_full returns the number of bytes advanced and advances the scan pointer if the second argument is true"
67
+ fails "StringScanner#scan_full returns the number of bytes advanced"
68
+ fails "StringScanner#search_full returns the matched string if the third argument is true and advances the scan pointer if the second argument is true"
69
+ fails "StringScanner#search_full returns the matched string if the third argument is true"
70
+ fails "StringScanner#search_full returns the number of bytes advanced and advances the scan pointer if the second argument is true"
71
+ fails "StringScanner#search_full returns the number of bytes advanced"
72
+ fails "StringScanner#string returns the string being scanned"
73
+ fails "StringScanner#string= changes the string being scanned to the argument and resets the scanner"
74
+ fails "StringScanner#string= converts the argument into a string using #to_str"
75
+ fails "StringScanner#unscan raises a ScanError when the previous match had failed"
76
+ fails "StringScanner#unscan set the scan pointer to the previous position"
77
+ fails "StringScanner.must_C_version returns self"
78
+ end
@@ -0,0 +1,26 @@
1
+ # NOTE: run bin/format-filters after changing this file
2
+ opal_filter "Struct" do
3
+ fails "Struct#deconstruct returns an array of attribute values" # NoMethodError: undefined method `deconstruct' for #<struct x=1, y=2>
4
+ fails "Struct#deconstruct_keys accepts argument position number as well but returns them as keys" # NoMethodError: undefined method `deconstruct_keys' for #<struct x=10, y=20, z=30>
5
+ fails "Struct#deconstruct_keys accepts nil argument and return all the attributes" # NoMethodError: undefined method `deconstruct_keys' for #<struct x=1, y=2>
6
+ fails "Struct#deconstruct_keys accepts string attribute names" # NoMethodError: undefined method `deconstruct_keys' for #<struct x=1, y=2>
7
+ fails "Struct#deconstruct_keys raise TypeError if passed anything accept nil or array" # Expected TypeError (/expected Array or nil/) but got: NoMethodError (undefined method `deconstruct_keys' for #<struct x=1, y=2>)
8
+ fails "Struct#deconstruct_keys requires one argument" # Expected ArgumentError (/wrong number of arguments \(given 0, expected 1\)/) but got: NoMethodError (undefined method `deconstruct_keys' for #<struct x=1>)
9
+ fails "Struct#deconstruct_keys returns a hash of attributes" # NoMethodError: undefined method `deconstruct_keys' for #<struct x=1, y=2>
10
+ fails "Struct#deconstruct_keys returns an empty hash when there are more keys than attributes" # NoMethodError: undefined method `deconstruct_keys' for #<struct x=1, y=2>
11
+ fails "Struct#deconstruct_keys returns at first not existing attribute name" # NoMethodError: undefined method `deconstruct_keys' for #<struct x=1, y=2>
12
+ fails "Struct#deconstruct_keys returns only specified keys" # NoMethodError: undefined method `deconstruct_keys' for #<struct x=1, y=2, z=3>
13
+ fails "Struct#hash returns different hashes for structs with different values when using keyword_init: true" # NameError: wrong constant name 1 non symbol member
14
+ fails "Struct#hash returns different hashes for structs with different values" # Expected "Hash" == "Hash" to be falsy but was true
15
+ fails "Struct#hash returns the same fixnum for structs with the same content"
16
+ fails "Struct#hash returns the same integer for structs with the same content" # Expected "Hash" (String) to be kind of Integer
17
+ fails "Struct#to_h with block coerces returned pair to Array with #to_ary" # Expected {"make"=>nil, "model"=>nil, "year"=>nil} == {"b"=>"b"} to be truthy but was false
18
+ fails "Struct#to_h with block converts [key, value] pairs returned by the block to a hash" # Expected {"make"=>"Ford", "model"=>"Ranger", "year"=>nil} == {"make"=>"ford", "model"=>"ranger", "year"=>""} to be truthy but was false
19
+ fails "Struct#to_h with block does not coerce returned pair to Array with #to_a" # Expected TypeError (/wrong element type MockObject/) but no exception was raised ({"make"=>nil, "model"=>nil, "year"=>nil} was returned)
20
+ fails "Struct#to_h with block raises ArgumentError if block returns longer or shorter array" # Expected ArgumentError (/element has wrong array length/) but no exception was raised ({"make"=>nil, "model"=>nil, "year"=>nil} was returned)
21
+ fails "Struct#to_h with block raises TypeError if block returns something other than Array" # Expected TypeError (/wrong element type String/) but no exception was raised ({"make"=>nil, "model"=>nil, "year"=>nil} was returned)
22
+ fails "Struct-based class#dup retains an included module in the ancestor chain for the struct's singleton class"
23
+ fails "Struct.new keyword_init: true option raises when there is a duplicate member" # Expected ArgumentError (duplicate member: foo) but no exception was raised (#<Class:0x294> was returned)
24
+ fails "Struct.new raises ArgumentError when there is a duplicate member" # Expected ArgumentError (duplicate member: foo) but no exception was raised (#<Class:0x256> was returned)
25
+ fails "Struct.new raises a ArgumentError if passed a Hash with an unknown key" # Just like "def m(a: nil); end; m(b: nil)" doesn't raise an error. That's a bug in the handling of kwargs
26
+ end
@@ -0,0 +1,7 @@
1
+ # NOTE: run bin/format-filters after changing this file
2
+ opal_filter "Symbol" do
3
+ fails "Symbol#to_proc produces a Proc that always returns [[:req], [:rest]] for #parameters" # Expected [["rest", "args"], ["block", "block"]] == [["req"], ["rest"]] to be truthy but was false
4
+ fails "Symbol#to_proc produces a Proc that always returns [[:rest]] for #parameters" # Expected [["rest", "args"], ["block", "block"]] == [["rest"]] to be truthy but was false
5
+ fails "Symbol#to_proc produces a Proc with arity -2" # Expected -1 == -2 to be truthy but was false
6
+ fails "Symbol#to_proc returns a Proc with #lambda? true" # Expected #<Proc:0xd6f0>.lambda? to be truthy but was false
7
+ end
@@ -0,0 +1,109 @@
1
+ # NOTE: run bin/format-filters after changing this file
2
+ opal_filter "Time" do
3
+ fails "Time#+ zone is a timezone object preserves time zone" # ArgumentError: Opal does not support explicitly specifying UTC offset for Time
4
+ fails "Time#- tracks microseconds from a Rational" # Expected 0 to equal 123456
5
+ fails "Time#- zone is a timezone object preserves time zone" # ArgumentError: Opal does not support explicitly specifying UTC offset for Time
6
+ fails "Time#ceil ceils to 0 decimal places with an explicit argument" # NoMethodError: undefined method `ceil' for 2010-03-30 05:43:25 UTC
7
+ fails "Time#ceil ceils to 2 decimal places with an explicit argument" # NoMethodError: undefined method `ceil' for 2010-03-30 05:43:25 UTC
8
+ fails "Time#ceil ceils to 4 decimal places with an explicit argument" # NoMethodError: undefined method `ceil' for 2010-03-30 05:43:25 UTC
9
+ fails "Time#ceil ceils to 7 decimal places with an explicit argument" # NoMethodError: undefined method `ceil' for 2010-03-30 05:43:25 UTC
10
+ fails "Time#ceil copies own timezone to the returning value" # NoMethodError: undefined method `ceil' for 2010-03-30 05:43:25 UTC
11
+ fails "Time#ceil defaults to ceiling to 0 places" # NoMethodError: undefined method `ceil' for 2010-03-30 05:43:25 UTC
12
+ fails "Time#ceil returns an instance of Time, even if #ceil is called on a subclass" # Expected Time to be identical to #<Class:0x38c06>
13
+ fails "Time#dup returns a clone of Time instance"
14
+ fails "Time#floor copies own timezone to the returning value" # NoMethodError: undefined method `floor' for 2010-03-30 05:43:25 UTC
15
+ fails "Time#floor defaults to flooring to 0 places" # NoMethodError: undefined method `floor' for 2010-03-30 05:43:25 UTC
16
+ fails "Time#floor floors to 0 decimal places with an explicit argument" # NoMethodError: undefined method `floor' for 2010-03-30 05:43:25 UTC
17
+ fails "Time#floor floors to 7 decimal places with an explicit argument" # NoMethodError: undefined method `floor' for 2010-03-30 05:43:25 UTC
18
+ fails "Time#floor returns an instance of Time, even if #floor is called on a subclass" # Expected Time to be identical to #<Class:0x188fa>
19
+ fails "Time#getlocal raises ArgumentError if the String argument is not in an ASCII-compatible encoding"
20
+ fails "Time#getlocal with a timezone argument accepts timezone argument that must have #local_to_utc and #utc_to_local methods" # Expected to not get Exception but got: NoMethodError (undefined method `getlocal' for 2000-01-01 12:00:00 UTC)
21
+ fails "Time#getlocal with a timezone argument does not raise exception if timezone does not implement #local_to_utc method" # Expected to not get Exception but got: NoMethodError (undefined method `getlocal' for 2000-01-01 12:00:00 UTC)
22
+ fails "Time#getlocal with a timezone argument raises TypeError if timezone does not implement #utc_to_local method" # Expected TypeError (/can't convert \w+ into an exact number/) but got: NoMethodError (undefined method `getlocal' for 2000-01-01 12:00:00 UTC)
23
+ fails "Time#getlocal with a timezone argument returns a Time in the timezone" # NoMethodError: undefined method `getlocal' for 2000-01-01 12:00:00 UTC
24
+ fails "Time#getlocal with a timezone argument subject's class implements .find_timezone method calls .find_timezone to build a time object if passed zone name as a timezone argument" # NoMethodError: undefined method `getlocal' for 2000-01-01 12:00:00 UTC
25
+ fails "Time#getlocal with a timezone argument subject's class implements .find_timezone method does not call .find_timezone if passed any not string/numeric/timezone timezone argument" # Expected TypeError (/can't convert \w+ into an exact number/) but got: NoMethodError (undefined method `getlocal' for 2000-01-01 12:00:00 UTC)
26
+ fails "Time#gmtime converts self to UTC, modifying the receiver" # Expected 2007-01-09 03:00:00 UTC to equal 2007-01-09 12:00:00 UTC
27
+ fails "Time#hash returns an Integer" # Expected "Time:100000" (String) to be an instance of Integer
28
+ fails "Time#inspect formats nanoseconds as a Rational" # NoMethodError: undefined method `nsec' for 2007-11-01 15:25:00 UTC
29
+ fails "Time#inspect formats the fixed offset time following the pattern 'yyyy-MM-dd HH:mm:ss +/-HHMM'"
30
+ fails "Time#inspect formats the local time following the pattern 'yyyy-MM-dd HH:mm:ss Z'" # Expected "2000-01-01 20:15:01 +1200" to equal "2000-01-01 20:15:01 +0100"
31
+ fails "Time#inspect preserves milliseconds" # Expected "2007-11-01 15:25:00 UTC" == "2007-11-01 15:25:00.123456 UTC" to be truthy but was false
32
+ fails "Time#localtime raises ArgumentError if the String argument is not in an ASCII-compatible encoding"
33
+ fails "Time#nsec returns a positive value for dates before the epoch" # NoMethodError: undefined method `nsec' for 1969-11-12 13:18:57 UTC
34
+ fails "Time#round copies own timezone to the returning value"
35
+ fails "Time#round defaults to rounding to 0 places"
36
+ fails "Time#round returns an instance of Time, even if #round is called on a subclass"
37
+ fails "Time#round rounds to 0 decimal places with an explicit argument"
38
+ fails "Time#round rounds to 7 decimal places with an explicit argument"
39
+ fails "Time#strftime rounds an offset to the nearest second when formatting with %z"
40
+ fails "Time#strftime should be able to print the commercial year with leading zeroes"
41
+ fails "Time#strftime should be able to print the commercial year with only two digits"
42
+ fails "Time#strftime should be able to show the commercial week day"
43
+ fails "Time#strftime should be able to show the number of seconds since the unix epoch" # fails under FIJI et al TZs
44
+ fails "Time#strftime should be able to show the timezone if available"
45
+ fails "Time#strftime should be able to show the timezone of the date with a : separator"
46
+ fails "Time#strftime should be able to show the week number with the week starting on Sunday (%U) and Monday (%W)"
47
+ fails "Time#strftime with %N formats the microseconds of the second with %6N"
48
+ fails "Time#strftime with %N formats the milliseconds of the second with %3N"
49
+ fails "Time#strftime with %N formats the nanoseconds of the second with %9N"
50
+ fails "Time#strftime with %N formats the nanoseconds of the second with %N"
51
+ fails "Time#strftime with %N formats the picoseconds of the second with %12N"
52
+ fails "Time#subsec returns 0 as an Integer for a Time with a whole number of seconds" # NoMethodError: undefined method `subsec' for 1970-01-01 01:01:40 +0100
53
+ fails "Time#succ is obsolete" # Expected warning to match: /Time#succ is obsolete/ but got: ""
54
+ fails "Time#to_f returns the float number of seconds + usecs since the epoch"
55
+ fails "Time#to_i rounds fractional seconds toward zero" # Expected -315619200 == -315619199 to be truthy but was false
56
+ fails "Time#to_s formats the fixed offset time following the pattern 'yyyy-MM-dd HH:mm:ss +/-HHMM'"
57
+ fails "Time#to_s formats the local time following the pattern 'yyyy-MM-dd HH:mm:ss Z'" # Expected "2000-01-01 20:15:01 +1200" to equal "2000-01-01 20:15:01 +0100"
58
+ fails "Time#tv_sec rounds fractional seconds toward zero" # Expected -315619200 == -315619199 to be truthy but was false
59
+ fails "Time#usec returns a positive value for dates before the epoch" # Expected 0 to equal 404240
60
+ fails "Time#utc converts self to UTC, modifying the receiver" # Expected 2007-01-09 03:00:00 UTC to equal 2007-01-09 12:00:00 UTC
61
+ fails "Time#zone Encoding.default_internal is set returns an ASCII string"
62
+ fails "Time#zone defaults to UTC when bad zones given" # Expected 3600 to equal 0
63
+ fails "Time.at :in keyword argument could be UTC offset as a String in '+HH:MM or '-HH:MM' format" # TypeError: no implicit conversion of Hash into Integer
64
+ fails "Time.at :in keyword argument could be UTC offset as a number of seconds" # TypeError: no implicit conversion of Hash into Integer
65
+ fails "Time.at :in keyword argument could be a timezone object" # TypeError: no implicit conversion of Hash into Integer
66
+ fails "Time.at passed Numeric passed BigDecimal doesn't round input value"
67
+ fails "Time.at passed Numeric roundtrips a Rational produced by #to_r"
68
+ fails "Time.at passed [Time, Numeric, format] :microsecond format traits second argument as microseconds" # ArgumentError: [Time.at] wrong number of arguments(3 for -2)
69
+ fails "Time.at passed [Time, Numeric, format] :microsecond format treats second argument as microseconds" # ArgumentError: [Time.at] wrong number of arguments(3 for -2)
70
+ fails "Time.at passed [Time, Numeric, format] :millisecond format traits second argument as milliseconds" # ArgumentError: [Time.at] wrong number of arguments(3 for -2)
71
+ fails "Time.at passed [Time, Numeric, format] :millisecond format treats second argument as milliseconds" # ArgumentError: [Time.at] wrong number of arguments(3 for -2)
72
+ fails "Time.at passed [Time, Numeric, format] :nanosecond format traits second argument as nanoseconds" # ArgumentError: [Time.at] wrong number of arguments(3 for -2)
73
+ fails "Time.at passed [Time, Numeric, format] :nanosecond format treats second argument as nanoseconds" # ArgumentError: [Time.at] wrong number of arguments(3 for -2)
74
+ fails "Time.at passed [Time, Numeric, format] :nsec format traits second argument as nanoseconds" # ArgumentError: [Time.at] wrong number of arguments(3 for -2)
75
+ fails "Time.at passed [Time, Numeric, format] :nsec format treats second argument as nanoseconds" # ArgumentError: [Time.at] wrong number of arguments(3 for -2)
76
+ fails "Time.at passed [Time, Numeric, format] :usec format traits second argument as microseconds" # ArgumentError: [Time.at] wrong number of arguments(3 for -2)
77
+ fails "Time.at passed [Time, Numeric, format] :usec format treats second argument as microseconds" # ArgumentError: [Time.at] wrong number of arguments(3 for -2)
78
+ fails "Time.at passed [Time, Numeric, format] supports Float second argument" # ArgumentError: [Time.at] wrong number of arguments(3 for -2)
79
+ fails "Time.at passed non-Time, non-Numeric with an argument that responds to #to_r needs for the argument to respond to #to_int too" # Mock 'rational-but-no-to_int' expected to receive to_r("any_args") exactly 1 times but received it 0 times
80
+ fails "Time.gm handles fractional usec close to rounding limit" # NoMethodError: undefined method `nsec' for 2000-01-01 12:30:00 UTC:Time
81
+ fails "Time.gm raises an ArgumentError for out of range microsecond" # Expected ArgumentError but no exception was raised (2000-01-01 20:15:01 UTC was returned)
82
+ fails "Time.local raises an ArgumentError for out of range microsecond" # Expected ArgumentError but no exception was raised (2000-01-01 20:15:01 +0200 was returned)
83
+ fails "Time.mktime raises an ArgumentError for out of range microsecond" # Expected ArgumentError but no exception was raised (2000-01-01 20:15:01 +0200 was returned)
84
+ fails "Time.new has at least microsecond precision" # NoMethodError: undefined method `nsec' for 2019-05-16 23:25:01 +0200
85
+ fails "Time.new uses the local timezone" # Expected 10800 to equal -28800
86
+ fails "Time.new with a timezone argument #name method cannot marshal Time if #name method isn't implemented" # ArgumentError: Opal does not support explicitly specifying UTC offset for Time
87
+ fails "Time.new with a timezone argument #name method uses the optional #name method for marshaling" # ArgumentError: Opal does not support explicitly specifying UTC offset for Time
88
+ fails "Time.new with a timezone argument Time-like argument of #utc_to_local and #local_to_utc methods has attribute values the same as a Time object in UTC" # ArgumentError: Opal does not support explicitly specifying UTC offset for Time
89
+ fails "Time.new with a timezone argument Time-like argument of #utc_to_local and #local_to_utc methods implements subset of Time methods" # ArgumentError: Opal does not support explicitly specifying UTC offset for Time
90
+ fails "Time.new with a timezone argument accepts timezone argument that must have #local_to_utc and #utc_to_local methods" # Expected to not get Exception but got: ArgumentError (Opal does not support explicitly specifying UTC offset for Time)
91
+ fails "Time.new with a timezone argument does not raise exception if timezone does not implement #utc_to_local method" # Expected to not get Exception but got: ArgumentError (Opal does not support explicitly specifying UTC offset for Time)
92
+ fails "Time.new with a timezone argument raises TypeError if timezone does not implement #local_to_utc method" # Expected TypeError (/can't convert \w+ into an exact number/) but got: ArgumentError (Opal does not support explicitly specifying UTC offset for Time)
93
+ fails "Time.new with a timezone argument returned value by #utc_to_local and #local_to_utc methods could be Time instance" # Expected to not get Exception but got: ArgumentError (Opal does not support explicitly specifying UTC offset for Time)
94
+ fails "Time.new with a timezone argument returned value by #utc_to_local and #local_to_utc methods could be Time subclass instance" # Expected to not get Exception but got: ArgumentError (Opal does not support explicitly specifying UTC offset for Time)
95
+ fails "Time.new with a timezone argument returned value by #utc_to_local and #local_to_utc methods could be any object with #to_i method" # Expected to not get Exception but got: ArgumentError (Opal does not support explicitly specifying UTC offset for Time)
96
+ fails "Time.new with a timezone argument returned value by #utc_to_local and #local_to_utc methods could have any #zone and #utc_offset because they are ignored" # ArgumentError: Opal does not support explicitly specifying UTC offset for Time
97
+ fails "Time.new with a timezone argument returned value by #utc_to_local and #local_to_utc methods leads to raising Argument error if difference between argument and result is too large" # Expected ArgumentError (utc_offset out of range) but got: ArgumentError (Opal does not support explicitly specifying UTC offset for Time)
98
+ fails "Time.new with a timezone argument returns a Time in the timezone" # ArgumentError: Opal does not support explicitly specifying UTC offset for Time
99
+ fails "Time.new with a timezone argument subject's class implements .find_timezone method calls .find_timezone to build a time object at loading marshaled data" # ArgumentError: Opal does not support explicitly specifying UTC offset for Time
100
+ fails "Time.new with a timezone argument subject's class implements .find_timezone method calls .find_timezone to build a time object if passed zone name as a timezone argument" # ArgumentError: Opal does not support explicitly specifying UTC offset for Time
101
+ fails "Time.new with a timezone argument subject's class implements .find_timezone method does not call .find_timezone if passed any not string/numeric/timezone timezone argument" # Expected TypeError (/can't convert \w+ into an exact number/) but got: ArgumentError (Opal does not support explicitly specifying UTC offset for Time)
102
+ fails "Time.new with a timezone argument the #abbr method is used by '%Z' in #strftime" # ArgumentError: Opal does not support explicitly specifying UTC offset for Time
103
+ fails "Time.new with a utc_offset argument raises ArgumentError if the month is greater than 12" # Expected ArgumentError (/(mon|argument) out of range/) but got: ArgumentError (Opal does not support explicitly specifying UTC offset for Time)
104
+ fails "Time.new with a utc_offset argument returns a Time with a UTC offset specified as +HH:MM:SS" # ArgumentError: Opal does not support explicitly specifying UTC offset for Time
105
+ fails "Time.now has at least microsecond precision" # NoMethodError: undefined method `nsec' for 2019-05-16 23:25:03 +0200
106
+ fails "Time.now uses the local timezone" # Expected 10800 to equal -28800
107
+ fails "Time.utc handles fractional usec close to rounding limit" # NoMethodError: undefined method `nsec' for 2000-01-01 12:30:00 UTC:Time
108
+ fails "Time.utc raises an ArgumentError for out of range microsecond" # Expected ArgumentError but no exception was raised (2000-01-01 20:15:01 UTC was returned)
109
+ end
@@ -0,0 +1,33 @@
1
+ # NOTE: run bin/format-filters after changing this file
2
+ opal_filter "UnboundMethod" do
3
+ fails "UnboundMethod#== returns true if both are aliases for a third method"
4
+ fails "UnboundMethod#== returns true if either is an alias for the other"
5
+ fails "UnboundMethod#== returns true if objects refer to the same method"
6
+ fails "UnboundMethod#== returns true if same method is extracted from the same subclass"
7
+ fails "UnboundMethod#arity for a Method generated by respond_to_missing? returns -1"
8
+ fails "UnboundMethod#bind returns Method returned for obj is equal to one directly returned by obj.method" # Expected #<Method: UnboundMethodSpecs::Methods#foo (defined in UnboundMethodSpecs::Methods in ruby/core/unboundmethod/fixtures/classes.rb:30)> to equal #<Method: UnboundMethodSpecs::Methods#foo (defined in UnboundMethodSpecs::Methods in ruby/core/unboundmethod/fixtures/classes.rb:30)>
9
+ fails "UnboundMethod#bind the returned Method is equal to the one directly returned by obj.method" # Expected #<Method: UnboundMethodSpecs::Methods#foo (defined in UnboundMethodSpecs::Methods in ruby/core/unboundmethod/fixtures/classes.rb:30)> to equal #<Method: UnboundMethodSpecs::Methods#foo (defined in UnboundMethodSpecs::Methods in ruby/core/unboundmethod/fixtures/classes.rb:30)>
10
+ fails "UnboundMethod#bind_call binds and calls a Kernel method retrieved from Object on BasicObject" # NoMethodError: undefined method `bind_call' for #<UnboundMethod: Object#instance_of? (defined in Kernel in <internal:corelib/kernel.rb>:253)>
11
+ fails "UnboundMethod#bind_call binds and calls a Parent's class method to any Child's class methods" # NoMethodError: undefined method `bind_call' for #<UnboundMethod: Class#class_method (defined in #<Class:UnboundMethodSpecs::Parent> in ruby/core/unboundmethod/fixtures/classes.rb:60)>
12
+ fails "UnboundMethod#bind_call binds and calls the method for any object kind_of? the Module the method is defined in" # NoMethodError: undefined method `bind_call' for #<UnboundMethod: UnboundMethodSpecs::Parent#foo (defined in UnboundMethodSpecs::Parent in ruby/core/unboundmethod/fixtures/classes.rb:59)>
13
+ fails "UnboundMethod#bind_call binds and calls the method if object is kind_of the Module the method defined in" # NoMethodError: undefined method `bind_call' for #<UnboundMethod: UnboundMethodSpecs::Methods#foo (defined in UnboundMethodSpecs::Methods in ruby/core/unboundmethod/fixtures/classes.rb:30)>
14
+ fails "UnboundMethod#bind_call binds and calls the method on any object when UnboundMethod is unbound from a module" # NoMethodError: undefined method `bind_call' for #<UnboundMethod: UnboundMethodSpecs::Mod#from_mod (defined in UnboundMethodSpecs::Mod in ruby/core/unboundmethod/fixtures/classes.rb:24)>
15
+ fails "UnboundMethod#bind_call raises TypeError if object is not kind_of? the Module the method defined in" # Expected TypeError but got: NoMethodError (undefined method `bind_call' for #<UnboundMethod: UnboundMethodSpecs::Methods#foo (defined in UnboundMethodSpecs::Methods in ruby/core/unboundmethod/fixtures/classes.rb:30)>)
16
+ fails "UnboundMethod#bind_call will raise when binding a an object singleton's method to another object" # Expected TypeError but got: NoMethodError (undefined method `bind_call' for #<UnboundMethod: UnboundMethodSpecs::Parent#singleton_method (defined in #<Class:#<UnboundMethodSpecs::Parent:0x30e3e>> in ruby/core/unboundmethod/bind_call_spec.rb:44)>)
17
+ fails "UnboundMethod#clone returns a copy of the UnboundMethod"
18
+ fails "UnboundMethod#hash returns the same value for builtin methods that are eql?"
19
+ fails "UnboundMethod#hash returns the same value for user methods that are eql?"
20
+ fails "UnboundMethod#inspect returns a String including all details" # Expected "#<UnboundMethod: UnboundMethodSpecs::Methods#from_mod (defined in UnboundMethodSpecs::Mod in ruby/core/unboundmethod/fixtures/classes.rb:24)>".start_with? "#<UnboundMethod: UnboundMethodSpecs::Methods(UnboundMethodSpecs::Mod)#from_mod" to be truthy but was false
21
+ fails "UnboundMethod#original_name returns the name of the method" # NoMethodError: undefined method `original_name' for #<UnboundMethod: String#upcase (defined in String in corelib/string.rb:1672)>
22
+ fails "UnboundMethod#original_name returns the original name even when aliased twice" # NoMethodError: undefined method `original_name' for #<UnboundMethod: UnboundMethodSpecs::Methods#foo (defined in UnboundMethodSpecs::Methods in ruby/core/unboundmethod/fixtures/classes.rb:30)>
23
+ fails "UnboundMethod#original_name returns the original name" # NoMethodError: undefined method `original_name' for #<UnboundMethod: UnboundMethodSpecs::Methods#foo (defined in UnboundMethodSpecs::Methods in ruby/core/unboundmethod/fixtures/classes.rb:30)>
24
+ fails "UnboundMethod#source_location sets the first value to the path of the file in which the method was defined" # Expected "ruby/core/unboundmethod/fixtures/classes.rb" to equal "./ruby/core/unboundmethod/fixtures/classes.rb"
25
+ fails "UnboundMethod#source_location works for define_method methods"
26
+ fails "UnboundMethod#source_location works for define_singleton_method methods"
27
+ fails "UnboundMethod#super_method returns nil when the parent's method is removed"
28
+ fails "UnboundMethod#super_method returns nil when there's no super method in the parent"
29
+ fails "UnboundMethod#super_method returns the method that would be called by super in the method"
30
+ fails "UnboundMethod#to_s does not show the defining module if it is the same as the origin" # Expected "#<UnboundMethod:0x10e>".start_with? "#<UnboundMethod: UnboundMethodSpecs::A#baz" to be truthy but was false
31
+ fails "UnboundMethod#to_s returns a String including all details" # Expected "#<UnboundMethod:0x14c>".start_with? "#<UnboundMethod: UnboundMethodSpecs::Methods(UnboundMethodSpecs::Mod)#from_mod" to be truthy but was false
32
+ fails "UnboundMethod#to_s the String shows the method name, Module defined in and Module extracted from"
33
+ end
@@ -0,0 +1,30 @@
1
+ # NOTE: run bin/format-filters after changing this file
2
+ opal_filter "warnings" do
3
+ fails "Array#join when $, is not nil warns" # Expected warning to match: /warning: \$, is set to non-nil value/ but got: ""
4
+ fails "Constant resolution within methods with dynamically assigned constants returns the updated value when a constant is reassigned" # Expected warning to match: /already initialized constant/
5
+ fails "Fixnum is deprecated" # Expected warning to match: /constant ::Fixnum is deprecated/ but got: ""
6
+ fails "Hash#fetch gives precedence to the default block over the default argument when passed both" # Expected warning to match: /block supersedes default value argument/
7
+ fails "Hash.[] ignores elements that are not arrays" # Expected warning to match: /ignoring wrong elements/
8
+ fails "Integer#** bignum switch to a Float when the values is too big" # Expected warning to match: /warning: in a\*\*b, b may be too big/ but got: ""
9
+ fails "Integer#** fixnum returns Float::INFINITY when the number is too big" # Expected warning to match: /warning: in a\*\*b, b may be too big/ but got: ""
10
+ fails "Integer#pow one argument is passed fixnum returns Float::INFINITY when the number is too big" # Expected warning to match: /warning: in a\*\*b, b may be too big/ but got: ""
11
+ fails "Kernel#=~ is deprecated" # Expected warning to match: /deprecated Object#=~ is called on Object/ but got: ""
12
+ fails "Literal (A::X) constant resolution with dynamically assigned constants returns the updated value when a constant is reassigned" # Expected warning to match: /already initialized constant/
13
+ fails "Literal Regexps matches against $_ (last input) in a conditional if no explicit matchee provided" # Expected warning to match: /regex literal in condition/
14
+ fails "Module#const_get with dynamically assigned constants returns the updated value of a constant" # Expected warning to match: /already initialized constant/
15
+ fails "Optional variable assignments using compunded constants with &&= assignments" # Expected warning to match: /already initialized constant/
16
+ fails "Optional variable assignments using compunded constants with operator assignments" # Expected warning to match: /already initialized constant/
17
+ fails "Predefined global $, warns if assigned non-nil" # Expected warning to match: /warning: `\$,' is deprecated/ but got: ""
18
+ fails "Predefined global $; warns if assigned non-nil" # Expected warning to match: /warning: `\$;' is deprecated/ but got: ""
19
+ fails "Regexp.new given a Regexp does not honour options given as additional arguments" # Expected warning to match: /flags ignored/
20
+ fails "String#split with String when $; is not nil warns" # Expected warning to match: /warning: \$; is set to non-nil value/ but got: ""
21
+ fails "Struct.new overwrites previously defined constants with string as first argument" # Expected warning to match: /redefining constant/
22
+ fails "The defined? keyword for a variable scoped constant returns 'constant' if the constant is defined in the scope of the class variable" # Expected warning to match: /class variable access from toplevel/
23
+ fails "The defined? keyword for a variable scoped constant returns nil if the class scoped constant is not defined" # Expected warning to match: /class variable access from toplevel/
24
+ fails "The defined? keyword for an expression with logical connectives returns nil for an expression with '!' and an unset class variable" # Expected warning to match: /class variable access from toplevel/
25
+ fails "The defined? keyword for an expression with logical connectives returns nil for an expression with 'not' and an unset class variable" # Expected warning to match: /class variable access from toplevel/
26
+ fails "The for expression allows a constant as an iterator name" # Expected warning to match: /already initialized constant/
27
+ fails "The predefined global constants includes FALSE" # Expected warning to match: /constant ::FALSE is deprecated/
28
+ fails "The predefined global constants includes NIL" # Expected warning to match: /constant ::NIL is deprecated/
29
+ fails "The predefined global constants includes TRUE" # Expected warning to match: /constant ::TRUE is deprecated/
30
+ end
@@ -0,0 +1,168 @@
1
+ # NOTE: run bin/format-filters after changing this file
2
+ opal_unsupported_filter "Array" do
3
+ fails "Array#* with a string with a tainted separator does not taint the result if the array has only one element"
4
+ fails "Array#* with a string with a tainted separator does not taint the result if the array is empty"
5
+ fails "Array#* with a string with a tainted separator taints the result if the array has two or more elements"
6
+ fails "Array#* with a string with an untrusted separator does not untrust the result if the array has only one element"
7
+ fails "Array#* with a string with an untrusted separator does not untrust the result if the array is empty"
8
+ fails "Array#* with a string with an untrusted separator untrusts the result if the array has two or more elements"
9
+ fails "Array#* with an integer copies the taint status of the original array even if the array is empty"
10
+ fails "Array#* with an integer copies the taint status of the original array even if the passed count is 0"
11
+ fails "Array#* with an integer copies the taint status of the original array if the passed count is not 0"
12
+ fails "Array#* with an integer copies the untrusted status of the original array even if the array is empty"
13
+ fails "Array#* with an integer copies the untrusted status of the original array even if the passed count is 0"
14
+ fails "Array#* with an integer copies the untrusted status of the original array if the passed count is not 0"
15
+ fails "Array#+ does not get infected even if an original array is tainted"
16
+ fails "Array#+ does not infected even if an original array is untrusted"
17
+ fails "Array#<< raises a RuntimeError on a frozen array"
18
+ fails "Array#[] raises a RangeError when the length is out of range of Fixnum"
19
+ fails "Array#[] raises a RangeError when the start index is out of range of Fixnum"
20
+ fails "Array#[]= checks frozen before attempting to coerce arguments"
21
+ fails "Array#[]= raises a RuntimeError on a frozen array"
22
+ fails "Array#clear keeps tainted status"
23
+ fails "Array#clear keeps untrusted status"
24
+ fails "Array#clear raises a RuntimeError on a frozen array"
25
+ fails "Array#clone copies frozen status from the original"
26
+ fails "Array#clone copies taint status from the original"
27
+ fails "Array#clone copies untrusted status from the original"
28
+ fails "Array#collect does not copy tainted status"
29
+ fails "Array#collect does not copy untrusted status"
30
+ fails "Array#collect! keeps tainted status"
31
+ fails "Array#collect! keeps untrusted status"
32
+ fails "Array#collect! when frozen raises a RuntimeError when calling #each on the returned Enumerator when empty"
33
+ fails "Array#collect! when frozen raises a RuntimeError when calling #each on the returned Enumerator"
34
+ fails "Array#collect! when frozen raises a RuntimeError when empty"
35
+ fails "Array#collect! when frozen raises a RuntimeError"
36
+ fails "Array#compact does not keep tainted status even if all elements are removed"
37
+ fails "Array#compact does not keep untrusted status even if all elements are removed"
38
+ fails "Array#compact! keeps tainted status even if all elements are removed"
39
+ fails "Array#compact! keeps untrusted status even if all elements are removed"
40
+ fails "Array#compact! raises a RuntimeError on a frozen array"
41
+ fails "Array#concat is not infected by the other"
42
+ fails "Array#concat is not infected untrustedness by the other"
43
+ fails "Array#concat keeps tainted status"
44
+ fails "Array#concat keeps the tainted status of elements"
45
+ fails "Array#concat keeps the untrusted status of elements"
46
+ fails "Array#concat keeps untrusted status"
47
+ fails "Array#concat raises a RuntimeError when Array is frozen and modification occurs"
48
+ fails "Array#concat raises a RuntimeError when Array is frozen and no modification occurs"
49
+ fails "Array#delete keeps tainted status"
50
+ fails "Array#delete keeps untrusted status"
51
+ fails "Array#delete raises a RuntimeError on a frozen array"
52
+ fails "Array#delete_at keeps tainted status"
53
+ fails "Array#delete_at keeps untrusted status"
54
+ fails "Array#delete_at raises a RuntimeError on a frozen array"
55
+ fails "Array#delete_if keeps tainted status"
56
+ fails "Array#delete_if keeps untrusted status"
57
+ fails "Array#delete_if raises a RuntimeError on a frozen array"
58
+ fails "Array#delete_if raises a RuntimeError on an empty frozen array"
59
+ fails "Array#delete_if returns an Enumerator if no block given, and the array is frozen"
60
+ fails "Array#dup copies taint status from the original"
61
+ fails "Array#dup copies untrusted status from the original"
62
+ fails "Array#eql? returns false if any corresponding elements are not #eql?"
63
+ fails "Array#fill does not replicate the filler"
64
+ fails "Array#fill raises a RuntimeError on a frozen array"
65
+ fails "Array#fill raises a RuntimeError on an empty frozen array"
66
+ fails "Array#fill with (filler, index, length) raises an ArgumentError or RangeError for too-large sizes"
67
+ fails "Array#first raises a RangeError when count is a Bignum"
68
+ fails "Array#flatten returns a tainted array if self is tainted"
69
+ fails "Array#flatten returns an untrusted array if self is untrusted"
70
+ fails "Array#flatten! raises a RuntimeError on frozen arrays when the array is modified"
71
+ fails "Array#flatten! raises a RuntimeError on frozen arrays when the array would not be modified"
72
+ fails "Array#frozen? returns false for an array being sorted by #sort"
73
+ fails "Array#frozen? returns true if array is frozen"
74
+ fails "Array#hash calls to_int on result of calling hash on each element"
75
+ fails "Array#hash returns the same fixnum for arrays with the same content"
76
+ fails "Array#initialize is private"
77
+ fails "Array#initialize raises a RuntimeError on frozen arrays"
78
+ fails "Array#insert raises a RuntimeError on frozen arrays when the array is modified"
79
+ fails "Array#insert raises a RuntimeError on frozen arrays when the array would not be modified"
80
+ fails "Array#inspect does not taint the result if the Array is tainted but empty"
81
+ fails "Array#inspect does not untrust the result if the Array is untrusted but empty"
82
+ fails "Array#inspect represents a recursive element with '[...]'"
83
+ fails "Array#inspect taints the result if an element is tainted"
84
+ fails "Array#inspect taints the result if the Array is non-empty and tainted"
85
+ fails "Array#inspect untrusts the result if an element is untrusted"
86
+ fails "Array#inspect untrusts the result if the Array is untrusted"
87
+ fails "Array#inspect with encoding does not raise if inspected result is not default external encoding" # NoMethodError: undefined method `encode!' for "\"utf_16be あ\"":String
88
+ fails "Array#inspect with encoding raises if inspected result is not default external encoding"
89
+ fails "Array#inspect with encoding returns a US-ASCII string for an empty Array"
90
+ fails "Array#inspect with encoding use US-ASCII encoding if the default external encoding is not ascii compatible"
91
+ fails "Array#inspect with encoding use the default external encoding if it is ascii compatible"
92
+ fails "Array#join does not taint the result if the Array is tainted but empty"
93
+ fails "Array#join does not untrust the result if the Array is untrusted but empty"
94
+ fails "Array#join fails for arrays with incompatibly-encoded strings"
95
+ fails "Array#join returns a US-ASCII string for an empty Array"
96
+ fails "Array#join taints the result if the Array is tainted and non-empty"
97
+ fails "Array#join taints the result if the result of coercing an element is tainted"
98
+ fails "Array#join untrusts the result if the Array is untrusted and non-empty"
99
+ fails "Array#join untrusts the result if the result of coercing an element is untrusted"
100
+ fails "Array#join uses the first encoding when other strings are compatible"
101
+ fails "Array#join uses the widest common encoding when other strings are incompatible"
102
+ fails "Array#join with a tainted separator does not taint the result if the array has only one element"
103
+ fails "Array#join with a tainted separator does not taint the result if the array is empty"
104
+ fails "Array#join with a tainted separator taints the result if the array has two or more elements"
105
+ fails "Array#join with an untrusted separator does not untrust the result if the array has only one element"
106
+ fails "Array#join with an untrusted separator does not untrust the result if the array is empty"
107
+ fails "Array#join with an untrusted separator untrusts the result if the array has two or more elements"
108
+ fails "Array#keep_if on frozen objects returns an Enumerator if no block is given"
109
+ fails "Array#keep_if on frozen objects with falsy block keeps elements after any exception"
110
+ fails "Array#keep_if on frozen objects with falsy block raises a RuntimeError"
111
+ fails "Array#keep_if on frozen objects with truthy block keeps elements after any exception"
112
+ fails "Array#keep_if on frozen objects with truthy block raises a RuntimeError"
113
+ fails "Array#map does not copy tainted status"
114
+ fails "Array#map does not copy untrusted status"
115
+ fails "Array#map! keeps tainted status"
116
+ fails "Array#map! keeps untrusted status"
117
+ fails "Array#map! when frozen raises a RuntimeError when calling #each on the returned Enumerator when empty"
118
+ fails "Array#map! when frozen raises a RuntimeError when calling #each on the returned Enumerator"
119
+ fails "Array#map! when frozen raises a RuntimeError when empty"
120
+ fails "Array#map! when frozen raises a RuntimeError"
121
+ fails "Array#pop keeps taint status"
122
+ fails "Array#pop keeps untrusted status"
123
+ fails "Array#pop passed a number n as an argument keeps taint status"
124
+ fails "Array#pop passed a number n as an argument keeps untrusted status"
125
+ fails "Array#pop passed a number n as an argument raises a RuntimeError on a frozen array"
126
+ fails "Array#pop passed a number n as an argument returns a trusted array even if the array is untrusted"
127
+ fails "Array#pop passed a number n as an argument returns an untainted array even if the array is tainted"
128
+ fails "Array#pop raises a RuntimeError on a frozen array"
129
+ fails "Array#pop raises a RuntimeError on an empty frozen array"
130
+ fails "Array#push raises a RuntimeError on a frozen array"
131
+ fails "Array#reject! raises a RuntimeError on a frozen array"
132
+ fails "Array#reject! raises a RuntimeError on an empty frozen array"
133
+ fails "Array#reject! returns an Enumerator if no block given, and the array is frozen"
134
+ fails "Array#replace raises a RuntimeError on a frozen array"
135
+ fails "Array#reverse! raises a RuntimeError on a frozen array"
136
+ fails "Array#select! on frozen objects with falsy block keeps elements after any exception"
137
+ fails "Array#select! on frozen objects with falsy block raises a RuntimeError"
138
+ fails "Array#select! on frozen objects with truthy block keeps elements after any exception"
139
+ fails "Array#select! on frozen objects with truthy block raises a RuntimeError"
140
+ fails "Array#shift passed a number n as an argument keeps taint status"
141
+ fails "Array#shift passed a number n as an argument returns an untainted array even if the array is tainted"
142
+ fails "Array#shift raises a RuntimeError on a frozen array"
143
+ fails "Array#shift raises a RuntimeError on an empty frozen array"
144
+ fails "Array#shuffle! raises a RuntimeError on a frozen array"
145
+ fails "Array#slice raises a RangeError when the length is out of range of Fixnum"
146
+ fails "Array#slice raises a RangeError when the start index is out of range of Fixnum"
147
+ fails "Array#slice! raises a RuntimeError on a frozen array"
148
+ fails "Array#sort! raises a RuntimeError on a frozen array"
149
+ fails "Array#to_s does not taint the result if the Array is tainted but empty"
150
+ fails "Array#to_s does not untrust the result if the Array is untrusted but empty"
151
+ fails "Array#to_s represents a recursive element with '[...]'"
152
+ fails "Array#to_s taints the result if an element is tainted"
153
+ fails "Array#to_s taints the result if the Array is non-empty and tainted"
154
+ fails "Array#to_s untrusts the result if an element is untrusted"
155
+ fails "Array#to_s untrusts the result if the Array is untrusted"
156
+ fails "Array#to_s with encoding does not raise if inspected result is not default external encoding" # NoMethodError: undefined method `encode!' for "\"utf_16be あ\"":String
157
+ fails "Array#to_s with encoding raises if inspected result is not default external encoding"
158
+ fails "Array#to_s with encoding returns a US-ASCII string for an empty Array"
159
+ fails "Array#to_s with encoding use US-ASCII encoding if the default external encoding is not ascii compatible"
160
+ fails "Array#to_s with encoding use the default external encoding if it is ascii compatible"
161
+ fails "Array#uniq compares elements with matching hash codes with #eql?" #RubySpec uses taint, which is not supported on Opal.
162
+ fails "Array#uniq uses eql? semantics" #RubySpec expects 1.0 and 1 to be seen as different, which is not supported on Opal.
163
+ fails "Array#uniq! doesn't yield to the block on a frozen array"
164
+ fails "Array#uniq! raises a RuntimeError on a frozen array when the array is modified"
165
+ fails "Array#uniq! raises a RuntimeError on a frozen array when the array would not be modified"
166
+ fails "Array#unshift raises a RuntimeError on a frozen array when the array is modified"
167
+ fails "Array#unshift raises a RuntimeError on a frozen array when the array would not be modified"
168
+ end