opal 1.0.5 → 1.1.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (394) hide show
  1. checksums.yaml +4 -4
  2. data/.codeclimate.yml +14 -12
  3. data/.gitattributes +1 -1
  4. data/.github/workflows/build.yml +15 -10
  5. data/.jshintrc +1 -1
  6. data/.overcommit.yml +35 -0
  7. data/.rubocop.yml +44 -7
  8. data/{.rubocop_todo.yml → .rubocop/todo.yml} +4 -5
  9. data/CHANGELOG.md +87 -2
  10. data/Gemfile +1 -2
  11. data/HACKING.md +2 -9
  12. data/README.md +20 -17
  13. data/UNRELEASED.md +108 -0
  14. data/benchmark-ips/bm_array_pop_1.rb +8 -0
  15. data/benchmark-ips/bm_array_shift.rb +7 -0
  16. data/benchmark-ips/class_shovel_vs_singleton_class.rb +16 -0
  17. data/bin/build-browser-source-map-support +5 -0
  18. data/bin/format-filters +54 -0
  19. data/bin/remove-filters +39 -0
  20. data/docs/roda-sprockets.md +86 -0
  21. data/docs/sinatra.md +5 -12
  22. data/examples/rack/Gemfile +1 -0
  23. data/examples/rack/app/application.rb +3 -0
  24. data/examples/rack/config.ru +5 -4
  25. data/exe/opal-repl +2 -83
  26. data/lib/opal/ast/builder.rb +1 -1
  27. data/lib/opal/builder.rb +2 -10
  28. data/lib/opal/builder_processors.rb +1 -1
  29. data/lib/opal/cli_runners.rb +27 -37
  30. data/lib/opal/cli_runners/applescript.rb +5 -44
  31. data/lib/opal/cli_runners/chrome.js +7 -35
  32. data/lib/opal/cli_runners/chrome.rb +75 -17
  33. data/lib/opal/cli_runners/compiler.rb +17 -0
  34. data/lib/opal/cli_runners/nashorn.rb +9 -43
  35. data/lib/opal/cli_runners/nodejs.rb +18 -47
  36. data/lib/opal/cli_runners/server.rb +18 -6
  37. data/lib/opal/cli_runners/source-map-support-browser.js +6445 -0
  38. data/lib/opal/cli_runners/source-map-support.js +639 -0
  39. data/lib/opal/cli_runners/system_runner.rb +45 -0
  40. data/lib/opal/compiler.rb +57 -29
  41. data/lib/opal/config.rb +0 -5
  42. data/lib/opal/erb.rb +1 -1
  43. data/lib/opal/magic_comments.rb +34 -0
  44. data/lib/opal/nodes/args/arity_check.rb +2 -1
  45. data/lib/opal/nodes/base.rb +1 -1
  46. data/lib/opal/nodes/call.rb +1 -4
  47. data/lib/opal/nodes/def.rb +2 -0
  48. data/lib/opal/nodes/iter.rb +1 -1
  49. data/lib/opal/nodes/literal.rb +19 -14
  50. data/lib/opal/nodes/logic.rb +5 -80
  51. data/lib/opal/nodes/masgn.rb +2 -0
  52. data/lib/opal/nodes/rescue.rb +1 -1
  53. data/lib/opal/nodes/super.rb +24 -10
  54. data/lib/opal/nodes/top.rb +5 -4
  55. data/lib/opal/parser/with_c_lexer.rb +2 -1
  56. data/lib/opal/parser/with_ruby_lexer.rb +1 -1
  57. data/lib/opal/path_reader.rb +2 -2
  58. data/lib/opal/paths.rb +8 -5
  59. data/lib/opal/repl.rb +103 -0
  60. data/lib/opal/rewriter.rb +4 -0
  61. data/lib/opal/rewriters/for_rewriter.rb +1 -1
  62. data/lib/opal/rewriters/js_reserved_words.rb +7 -7
  63. data/lib/opal/rewriters/numblocks.rb +31 -0
  64. data/lib/opal/rewriters/returnable_logic.rb +33 -0
  65. data/lib/opal/version.rb +1 -1
  66. data/opal.gemspec +25 -25
  67. data/opal/corelib/array.rb +160 -118
  68. data/opal/corelib/array/pack.rb +5 -3
  69. data/opal/corelib/basic_object.rb +4 -4
  70. data/opal/corelib/class.rb +2 -1
  71. data/opal/corelib/comparable.rb +49 -31
  72. data/opal/corelib/constants.rb +5 -5
  73. data/opal/corelib/enumerable.rb +108 -46
  74. data/opal/corelib/enumerator.rb +27 -12
  75. data/opal/corelib/file.rb +3 -1
  76. data/opal/corelib/hash.rb +6 -1
  77. data/opal/corelib/helpers.rb +8 -28
  78. data/opal/corelib/io.rb +12 -7
  79. data/opal/corelib/kernel.rb +45 -14
  80. data/opal/corelib/kernel/format.rb +3 -1
  81. data/opal/corelib/math.rb +8 -6
  82. data/opal/corelib/method.rb +8 -0
  83. data/opal/corelib/module.rb +17 -2
  84. data/opal/corelib/number.rb +3 -12
  85. data/opal/corelib/proc.rb +16 -0
  86. data/opal/corelib/random/mersenne_twister.rb +147 -0
  87. data/opal/corelib/range.rb +3 -13
  88. data/opal/corelib/regexp.rb +10 -6
  89. data/opal/corelib/runtime.js +208 -81
  90. data/opal/corelib/string.rb +55 -49
  91. data/opal/corelib/string/encoding.rb +109 -32
  92. data/opal/corelib/string/unpack.rb +2 -17
  93. data/opal/corelib/struct.rb +14 -1
  94. data/opal/corelib/time.rb +4 -0
  95. data/opal/opal.rb +1 -1
  96. data/opal/opal/mini.rb +1 -1
  97. data/package.json +1 -0
  98. data/spec/README.md +10 -0
  99. data/spec/filters/bugs/array.rb +76 -0
  100. data/spec/filters/bugs/base64.rb +10 -0
  101. data/spec/filters/bugs/basicobject.rb +12 -0
  102. data/spec/filters/bugs/bigdecimal.rb +248 -0
  103. data/spec/filters/bugs/class.rb +12 -0
  104. data/spec/filters/bugs/complex.rb +7 -0
  105. data/spec/filters/bugs/date.rb +104 -0
  106. data/spec/filters/bugs/encoding.rb +259 -0
  107. data/spec/filters/bugs/enumerable.rb +26 -0
  108. data/spec/filters/bugs/enumerator.rb +48 -0
  109. data/spec/filters/bugs/exception.rb +120 -0
  110. data/spec/filters/bugs/file.rb +48 -0
  111. data/spec/filters/bugs/float.rb +74 -0
  112. data/spec/filters/bugs/hash.rb +60 -0
  113. data/spec/filters/bugs/integer.rb +78 -0
  114. data/spec/filters/bugs/io.rb +9 -0
  115. data/spec/filters/bugs/kernel.rb +401 -0
  116. data/spec/filters/bugs/language.rb +451 -0
  117. data/spec/filters/bugs/marshal.rb +50 -0
  118. data/spec/filters/bugs/math.rb +4 -0
  119. data/spec/filters/bugs/method.rb +79 -0
  120. data/spec/filters/bugs/module.rb +281 -0
  121. data/spec/filters/bugs/nilclass.rb +4 -0
  122. data/spec/filters/bugs/numeric.rb +27 -0
  123. data/spec/filters/bugs/openstruct.rb +8 -0
  124. data/spec/filters/bugs/pack_unpack.rb +138 -0
  125. data/spec/filters/bugs/pathname.rb +9 -0
  126. data/spec/filters/bugs/proc.rb +80 -0
  127. data/spec/filters/bugs/random.rb +20 -0
  128. data/spec/filters/bugs/range.rb +139 -0
  129. data/spec/filters/bugs/rational.rb +12 -0
  130. data/spec/filters/bugs/regexp.rb +91 -0
  131. data/spec/filters/bugs/set.rb +51 -0
  132. data/spec/filters/bugs/singleton.rb +7 -0
  133. data/spec/filters/bugs/string.rb +341 -0
  134. data/spec/filters/bugs/stringscanner.rb +78 -0
  135. data/spec/filters/bugs/struct.rb +26 -0
  136. data/spec/filters/bugs/symbol.rb +7 -0
  137. data/spec/filters/bugs/time.rb +109 -0
  138. data/spec/filters/bugs/unboundmethod.rb +33 -0
  139. data/spec/filters/bugs/warnings.rb +30 -0
  140. data/spec/filters/unsupported/array.rb +168 -0
  141. data/spec/filters/unsupported/basicobject.rb +15 -0
  142. data/spec/filters/unsupported/bignum.rb +55 -0
  143. data/spec/filters/unsupported/class.rb +5 -0
  144. data/spec/filters/unsupported/delegator.rb +6 -0
  145. data/spec/filters/unsupported/enumerable.rb +12 -0
  146. data/spec/filters/unsupported/enumerator.rb +14 -0
  147. data/spec/filters/unsupported/file.rb +4 -0
  148. data/spec/filters/unsupported/fixnum.rb +15 -0
  149. data/spec/filters/unsupported/float.rb +47 -0
  150. data/spec/filters/unsupported/freeze.rb +259 -0
  151. data/spec/filters/unsupported/hash.rb +44 -0
  152. data/spec/filters/unsupported/integer.rb +101 -0
  153. data/spec/filters/unsupported/kernel.rb +35 -0
  154. data/spec/filters/unsupported/language.rb +25 -0
  155. data/spec/filters/unsupported/marshal.rb +44 -0
  156. data/spec/filters/unsupported/matchdata.rb +63 -0
  157. data/spec/filters/unsupported/math.rb +4 -0
  158. data/spec/filters/unsupported/pathname.rb +4 -0
  159. data/spec/filters/unsupported/privacy.rb +287 -0
  160. data/spec/filters/unsupported/proc.rb +4 -0
  161. data/spec/filters/unsupported/random.rb +5 -0
  162. data/spec/filters/unsupported/range.rb +8 -0
  163. data/spec/filters/unsupported/regexp.rb +70 -0
  164. data/spec/filters/unsupported/set.rb +5 -0
  165. data/spec/filters/unsupported/singleton.rb +7 -0
  166. data/spec/filters/unsupported/string.rb +687 -0
  167. data/spec/filters/unsupported/struct.rb +7 -0
  168. data/spec/filters/unsupported/symbol.rb +21 -0
  169. data/spec/filters/unsupported/taint.rb +162 -0
  170. data/spec/filters/unsupported/thread.rb +10 -0
  171. data/spec/filters/unsupported/time.rb +204 -0
  172. data/spec/filters/unsupported/usage_of_files.rb +262 -0
  173. data/spec/lib/builder_processors_spec.rb +44 -0
  174. data/spec/lib/builder_spec.rb +133 -0
  175. data/spec/lib/cli_runners/server_spec.rb +25 -0
  176. data/spec/lib/cli_runners_spec.rb +16 -0
  177. data/spec/lib/cli_spec.rb +256 -0
  178. data/spec/lib/compiler_spec.rb +693 -0
  179. data/spec/lib/config_spec.rb +112 -0
  180. data/spec/lib/dependency_resolver_spec.rb +43 -0
  181. data/spec/lib/deprecations_spec.rb +17 -0
  182. data/spec/lib/fixtures/complex_sprockets.js.rb.erb +4 -0
  183. data/spec/lib/fixtures/file_with_directives.js +2 -0
  184. data/spec/lib/fixtures/jst_file.js.jst +1 -0
  185. data/spec/lib/fixtures/no_requires.rb +1 -0
  186. data/spec/lib/fixtures/opal_file.rb +2 -0
  187. data/spec/lib/fixtures/require_tree_test.rb +3 -0
  188. data/spec/lib/fixtures/required_file.js +1 -0
  189. data/spec/lib/fixtures/required_tree_test/required_file1.rb +1 -0
  190. data/spec/lib/fixtures/required_tree_test/required_file2.rb +1 -0
  191. data/spec/lib/fixtures/requires.rb +7 -0
  192. data/spec/lib/fixtures/source_location_test.rb +7 -0
  193. data/spec/lib/fixtures/source_map.rb +1 -0
  194. data/spec/lib/fixtures/source_map/subfolder/other_file.rb +1 -0
  195. data/spec/lib/fixtures/sprockets_file.js.rb +3 -0
  196. data/spec/lib/fixtures/sprockets_require_tree_test.rb +3 -0
  197. data/spec/lib/path_reader_spec.rb +47 -0
  198. data/spec/lib/paths_spec.rb +18 -0
  199. data/spec/lib/repl_spec.rb +28 -0
  200. data/spec/lib/rewriters/base_spec.rb +68 -0
  201. data/spec/lib/rewriters/binary_operator_assignment_spec.rb +153 -0
  202. data/spec/lib/rewriters/block_to_iter_spec.rb +28 -0
  203. data/spec/lib/rewriters/dot_js_syntax_spec.rb +108 -0
  204. data/spec/lib/rewriters/explicit_writer_return_spec.rb +186 -0
  205. data/spec/lib/rewriters/for_rewriter_spec.rb +92 -0
  206. data/spec/lib/rewriters/hashes/key_duplicates_rewriter_spec.rb +47 -0
  207. data/spec/lib/rewriters/js_reserved_words_spec.rb +119 -0
  208. data/spec/lib/rewriters/logical_operator_assignment_spec.rb +202 -0
  209. data/spec/lib/rewriters/opal_engine_check_spec.rb +84 -0
  210. data/spec/lib/rewriters/returnable_logic_spec.rb +52 -0
  211. data/spec/lib/rewriters/rubyspec/filters_rewriter_spec.rb +59 -0
  212. data/spec/lib/simple_server_spec.rb +56 -0
  213. data/spec/lib/source_map/file_spec.rb +67 -0
  214. data/spec/lib/source_map/index_spec.rb +80 -0
  215. data/spec/lib/spec_helper.rb +105 -0
  216. data/spec/mspec-opal/formatters.rb +197 -0
  217. data/spec/mspec-opal/runner.rb +172 -0
  218. data/spec/opal/compiler/irb_spec.rb +44 -0
  219. data/spec/opal/compiler/unicode_spec.rb +10 -0
  220. data/spec/opal/core/array/dup_spec.rb +23 -0
  221. data/spec/opal/core/array/intersection_spec.rb +38 -0
  222. data/spec/opal/core/array/minus_spec.rb +38 -0
  223. data/spec/opal/core/array/union_spec.rb +38 -0
  224. data/spec/opal/core/array/uniq_spec.rb +49 -0
  225. data/spec/opal/core/class/inherited_spec.rb +18 -0
  226. data/spec/opal/core/enumerable/all_break_spec.rb +5 -0
  227. data/spec/opal/core/enumerable/any_break_spec.rb +5 -0
  228. data/spec/opal/core/enumerable/collect_break_spec.rb +13 -0
  229. data/spec/opal/core/enumerable/count_break_spec.rb +5 -0
  230. data/spec/opal/core/enumerable/detect_break_spec.rb +5 -0
  231. data/spec/opal/core/enumerable/drop_while_break_spec.rb +5 -0
  232. data/spec/opal/core/enumerable/each_slice_break_spec.rb +6 -0
  233. data/spec/opal/core/enumerable/each_with_index_break_spec.rb +5 -0
  234. data/spec/opal/core/enumerable/each_with_object_break_spec.rb +5 -0
  235. data/spec/opal/core/enumerable/find_all_break_spec.rb +5 -0
  236. data/spec/opal/core/enumerable/find_index_break_spec.rb +5 -0
  237. data/spec/opal/core/enumerable/grep_break_spec.rb +5 -0
  238. data/spec/opal/core/enumerable/max_break_spec.rb +5 -0
  239. data/spec/opal/core/enumerable/max_by_break_spec.rb +5 -0
  240. data/spec/opal/core/enumerable/min_break_spec.rb +5 -0
  241. data/spec/opal/core/enumerable/min_by_break_spec.rb +5 -0
  242. data/spec/opal/core/enumerable/none_break_spec.rb +5 -0
  243. data/spec/opal/core/enumerable/one_break_spec.rb +5 -0
  244. data/spec/opal/core/enumerable/reduce_break_spec.rb +5 -0
  245. data/spec/opal/core/enumerable/take_while_break_spec.rb +5 -0
  246. data/spec/opal/core/enumerator/with_index_spec.rb +6 -0
  247. data/spec/opal/core/exception_spec.rb +8 -0
  248. data/spec/opal/core/fixtures/require_tree_files/file 1.rb +1 -0
  249. data/spec/opal/core/fixtures/require_tree_files/file 2.rb +1 -0
  250. data/spec/opal/core/fixtures/require_tree_files/file 3.rb +1 -0
  251. data/spec/opal/core/fixtures/require_tree_files/file 4.rb +1 -0
  252. data/spec/opal/core/fixtures/require_tree_files/file 5.rb +1 -0
  253. data/spec/opal/core/fixtures/require_tree_files/nested/nested 1.rb +1 -0
  254. data/spec/opal/core/fixtures/require_tree_files/nested/nested 2.rb +1 -0
  255. data/spec/opal/core/fixtures/require_tree_files/other/other 1.rb +1 -0
  256. data/spec/opal/core/fixtures/require_tree_with_dot/file 1.rb +1 -0
  257. data/spec/opal/core/fixtures/require_tree_with_dot/file 2.rb +1 -0
  258. data/spec/opal/core/fixtures/require_tree_with_dot/file 3.rb +1 -0
  259. data/spec/opal/core/fixtures/require_tree_with_dot/index.rb +3 -0
  260. data/spec/opal/core/hash/internals_spec.rb +339 -0
  261. data/spec/opal/core/helpers_spec.rb +14 -0
  262. data/spec/opal/core/iterable_props_spec.rb +53 -0
  263. data/spec/opal/core/kernel/at_exit_spec.rb +70 -0
  264. data/spec/opal/core/kernel/freeze_spec.rb +15 -0
  265. data/spec/opal/core/kernel/instance_variables_spec.rb +110 -0
  266. data/spec/opal/core/kernel/methods_spec.rb +25 -0
  267. data/spec/opal/core/kernel/public_methods_spec.rb +25 -0
  268. data/spec/opal/core/kernel/require_tree_spec.rb +18 -0
  269. data/spec/opal/core/kernel/respond_to_spec.rb +15 -0
  270. data/spec/opal/core/language/DATA/characters_support_spec.rb +9 -0
  271. data/spec/opal/core/language/DATA/empty___END___spec.rb +7 -0
  272. data/spec/opal/core/language/DATA/multiple___END___spec.rb +10 -0
  273. data/spec/opal/core/language/arguments/mlhs_arg_spec.rb +18 -0
  274. data/spec/opal/core/language/keyword_arguments_spec.rb +9 -0
  275. data/spec/opal/core/language/numblocks_spec.rb +16 -0
  276. data/spec/opal/core/language/safe_navigator_spec.rb +7 -0
  277. data/spec/opal/core/language/while_spec.rb +31 -0
  278. data/spec/opal/core/language_spec.rb +29 -0
  279. data/spec/opal/core/marshal/dump_spec.rb +81 -0
  280. data/spec/opal/core/marshal/load_spec.rb +13 -0
  281. data/spec/opal/core/module_spec.rb +27 -0
  282. data/spec/opal/core/object_id_spec.rb +56 -0
  283. data/spec/opal/core/regexp/interpolation_spec.rb +40 -0
  284. data/spec/opal/core/regexp/match_spec.rb +78 -0
  285. data/spec/opal/core/runtime/bridged_classes_spec.rb +123 -0
  286. data/spec/opal/core/runtime/constants_spec.rb +16 -0
  287. data/spec/opal/core/runtime/eval_spec.rb +5 -0
  288. data/spec/opal/core/runtime/exit_spec.rb +29 -0
  289. data/spec/opal/core/runtime/is_a_spec.rb +48 -0
  290. data/spec/opal/core/runtime/loaded_spec.rb +20 -0
  291. data/spec/opal/core/runtime/main_methods_spec.rb +39 -0
  292. data/spec/opal/core/runtime/method_missing_spec.rb +68 -0
  293. data/spec/opal/core/runtime/rescue_spec.rb +37 -0
  294. data/spec/opal/core/runtime/string_spec.rb +25 -0
  295. data/spec/opal/core/runtime/truthy_spec.rb +61 -0
  296. data/spec/opal/core/runtime_spec.rb +58 -0
  297. data/spec/opal/core/string/each_byte_spec.rb +19 -0
  298. data/spec/opal/core/string/gsub_spec.rb +35 -0
  299. data/spec/opal/core/string/to_sym_spec.rb +9 -0
  300. data/spec/opal/core/string_spec.rb +28 -0
  301. data/spec/opal/core/struct/dup_spec.rb +11 -0
  302. data/spec/opal/core/time_spec.rb +68 -0
  303. data/spec/opal/stdlib/erb/erb_spec.rb +30 -0
  304. data/spec/opal/stdlib/erb/inline_block.opalerb +3 -0
  305. data/spec/opal/stdlib/erb/quoted.opalerb +1 -0
  306. data/spec/opal/stdlib/erb/simple.opalerb +1 -0
  307. data/spec/opal/stdlib/js_spec.rb +72 -0
  308. data/spec/opal/stdlib/json/ext_spec.rb +55 -0
  309. data/spec/opal/stdlib/json/parse_spec.rb +37 -0
  310. data/spec/opal/stdlib/logger/logger_spec.rb +308 -0
  311. data/spec/opal/stdlib/native/alias_native_spec.rb +27 -0
  312. data/spec/opal/stdlib/native/array_spec.rb +11 -0
  313. data/spec/opal/stdlib/native/date_spec.rb +12 -0
  314. data/spec/opal/stdlib/native/deprecated_include_spec.rb +8 -0
  315. data/spec/opal/stdlib/native/each_spec.rb +13 -0
  316. data/spec/opal/stdlib/native/element_reference_spec.rb +16 -0
  317. data/spec/opal/stdlib/native/exposure_spec.rb +33 -0
  318. data/spec/opal/stdlib/native/ext_spec.rb +19 -0
  319. data/spec/opal/stdlib/native/hash_spec.rb +67 -0
  320. data/spec/opal/stdlib/native/initialize_spec.rb +17 -0
  321. data/spec/opal/stdlib/native/method_missing_spec.rb +51 -0
  322. data/spec/opal/stdlib/native/native_alias_spec.rb +26 -0
  323. data/spec/opal/stdlib/native/native_class_spec.rb +18 -0
  324. data/spec/opal/stdlib/native/native_module_spec.rb +13 -0
  325. data/spec/opal/stdlib/native/native_reader_spec.rb +22 -0
  326. data/spec/opal/stdlib/native/native_writer_spec.rb +30 -0
  327. data/spec/opal/stdlib/native/new_spec.rb +92 -0
  328. data/spec/opal/stdlib/native/struct_spec.rb +12 -0
  329. data/spec/opal/stdlib/pp_spec.rb +5 -0
  330. data/spec/opal/stdlib/promise/always_spec.rb +49 -0
  331. data/spec/opal/stdlib/promise/error_spec.rb +15 -0
  332. data/spec/opal/stdlib/promise/rescue_spec.rb +53 -0
  333. data/spec/opal/stdlib/promise/then_spec.rb +79 -0
  334. data/spec/opal/stdlib/promise/trace_spec.rb +51 -0
  335. data/spec/opal/stdlib/promise/value_spec.rb +15 -0
  336. data/spec/opal/stdlib/promise/when_spec.rb +34 -0
  337. data/spec/opal/stdlib/source_map_spec.rb +8 -0
  338. data/spec/opal/stdlib/strscan/scan_spec.rb +11 -0
  339. data/spec/opal/stdlib/template/paths_spec.rb +10 -0
  340. data/spec/opal/stdlib/thread/mutex_spec.rb +40 -0
  341. data/spec/opal/stdlib/thread/thread_queue_spec.rb +32 -0
  342. data/spec/opal/stdlib/thread/thread_spec.rb +60 -0
  343. data/spec/ruby_specs +183 -0
  344. data/spec/spec_helper.rb +31 -0
  345. data/spec/support/guard_platform.rb +4 -0
  346. data/spec/support/match_helpers.rb +57 -0
  347. data/spec/support/mspec_rspec_adapter.rb +33 -0
  348. data/spec/support/rewriters_helper.rb +54 -0
  349. data/spec/support/source_map_helper.rb +190 -0
  350. data/stdlib/base64.rb +2 -2
  351. data/stdlib/bigdecimal.rb +15 -3
  352. data/stdlib/bigdecimal/bignumber.js.rb +1 -1
  353. data/stdlib/bigdecimal/util.rb +148 -0
  354. data/stdlib/delegate.rb +8 -0
  355. data/stdlib/nodejs/fileutils.rb +1 -1
  356. data/stdlib/nodejs/kernel.rb +0 -13
  357. data/stdlib/nodejs/stacktrace.rb +4 -179
  358. data/stdlib/ostruct.rb +5 -0
  359. data/stdlib/pp.rb +586 -19
  360. data/stdlib/prettyprint.rb +556 -0
  361. data/stdlib/rbconfig/sizeof.rb +2 -0
  362. data/stdlib/securerandom.rb +32 -0
  363. data/stdlib/set.rb +36 -0
  364. data/stdlib/strscan.rb +15 -0
  365. data/tasks/benchmarking.rake +1 -1
  366. data/tasks/releasing.rake +0 -3
  367. data/tasks/testing.rake +16 -11
  368. data/tasks/testing/mspec_special_calls.rb +1 -19
  369. data/test/nodejs/fixtures/cat.png +0 -0
  370. data/test/nodejs/fixtures/hello.rb +1 -0
  371. data/test/nodejs/fixtures/iso88591.txt +1 -0
  372. data/test/nodejs/fixtures/utf8.txt +1 -0
  373. data/test/nodejs/fixtures/win1258.txt +1 -0
  374. data/test/nodejs/test_dir.rb +39 -0
  375. data/test/nodejs/test_env.rb +62 -0
  376. data/test/nodejs/test_error.rb +29 -0
  377. data/test/nodejs/test_file.rb +206 -0
  378. data/test/nodejs/test_file_encoding.rb +20 -0
  379. data/test/nodejs/test_io.rb +18 -0
  380. data/test/nodejs/test_opal_builder.rb +12 -0
  381. data/test/nodejs/test_pathname.rb +16 -0
  382. data/test/opal/cat.png +0 -0
  383. data/test/opal/http_server.rb +52 -0
  384. data/test/opal/test_base64.rb +115 -0
  385. data/test/opal/test_keyword.rb +590 -0
  386. data/test/opal/test_matrix.rb +661 -0
  387. data/test/opal/test_openuri.rb +53 -0
  388. data/test/opal/unsupported_and_bugs.rb +39 -0
  389. data/yarn.lock +1114 -3
  390. metadata +889 -31
  391. data/lib/opal/nodes/runtime_helpers.rb +0 -51
  392. data/opal/corelib/random/MersenneTwister.js +0 -137
  393. data/opal/corelib/random/mersenne_twister.js.rb +0 -13
  394. data/stdlib/bigdecimal/kernel.rb +0 -5
@@ -0,0 +1,120 @@
1
+ # NOTE: run bin/format-filters after changing this file
2
+ opal_filter "Exception" do
3
+ fails "An Exception reaching the top level is printed on STDERR" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x590>
4
+ fails "An Exception reaching the top level the Exception#cause is printed to STDERR with backtraces" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x50c96>
5
+ fails "An Exception reaching the top level with a custom backtrace is printed on STDERR" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x590>
6
+ fails "Errno::EAGAIN is the same class as Errno::EWOULDBLOCK if they represent the same errno value"
7
+ fails "Errno::EINVAL.new accepts an optional custom message and location"
8
+ fails "Errno::EINVAL.new accepts an optional custom message"
9
+ fails "Errno::EINVAL.new can be called with no arguments"
10
+ fails "Errno::EMFILE can be subclassed"
11
+ fails "Errno::ENOTSUP is defined" # Expected Errno to have constant 'ENOTSUP' but it does not
12
+ fails "Errno::ENOTSUP is the same class as Errno::EOPNOTSUPP if they represent the same errno value" # NameError: uninitialized constant Errno::ENOTSUP
13
+ fails "Exception has the right class hierarchy" # NameError: uninitialized constant FiberError
14
+ fails "Exception is a superclass of Interrupt"
15
+ fails "Exception is a superclass of SystemStackError"
16
+ fails "Exception#== returns true if both exceptions have the same class, no message, and no backtrace"
17
+ fails "Exception#== returns true if both exceptions have the same class, the same message, and no backtrace"
18
+ fails "Exception#== returns true if both exceptions have the same class, the same message, and the same backtrace"
19
+ fails "Exception#== returns true if one exception is the dup'd copy of the other"
20
+ fails "Exception#== returns true if the two objects subclass Exception and have the same message and backtrace"
21
+ fails "Exception#backtrace captures the backtrace for an exception into $!" # Expected "RuntimeError: " =~ /backtrace_spec/ to be truthy but was nil
22
+ fails "Exception#backtrace captures the backtrace for an exception into $@" # NoMethodError: undefined method `first' for nil
23
+ fails "Exception#backtrace includes the filename of the location immediately prior to where self raised in the second element"
24
+ fails "Exception#backtrace includes the filename of the location where self raised in the first element"
25
+ fails "Exception#backtrace includes the line number of the location immediately prior to where self raised in the second element"
26
+ fails "Exception#backtrace includes the line number of the location where self raised in the first element"
27
+ fails "Exception#backtrace includes the name of the method from where self raised in the first element"
28
+ fails "Exception#backtrace produces a backtrace for an exception captured using $!" # Expected "RuntimeError" to match /backtrace_spec/
29
+ fails "Exception#backtrace returns an Array that can be updated" # Expected "RuntimeError" to equal "backtrace first"
30
+ fails "Exception#backtrace returns nil if no backtrace was set"
31
+ fails "Exception#backtrace returns the same array after duping"
32
+ fails "Exception#backtrace_locations produces a backtrace for an exception captured using $!" # NoMethodError: undefined method `backtrace_locations' for #<RuntimeError: RuntimeError>
33
+ fails "Exception#backtrace_locations returns an Array that can be updated" # NoMethodError: undefined method `backtrace_locations' for #<RuntimeError: RuntimeError>
34
+ fails "Exception#backtrace_locations returns an Array" # NoMethodError: undefined method `backtrace_locations' for #<RuntimeError: RuntimeError>
35
+ fails "Exception#backtrace_locations returns nil if no backtrace was set" # NoMethodError: undefined method `backtrace_locations' for #<RuntimeError: RuntimeError>
36
+ fails "Exception#backtrace_locations sets each element to a Thread::Backtrace::Location" # NoMethodError: undefined method `backtrace_locations' for #<RuntimeError: RuntimeError>
37
+ fails "Exception#cause is not set to the exception itself when it is re-raised" # NoMethodError: undefined method `cause' for #<RuntimeError: RuntimeError>
38
+ fails "Exception#cause is set for internal errors caused by user errors" # Expected ZeroDivisionError but no exception was raised (Infinity was returned)
39
+ fails "Exception#cause is set for user errors caused by internal errors" # Expected RuntimeError but no exception was raised (Infinity was returned)
40
+ fails "Exception#cause returns the active exception when an exception is raised"
41
+ fails "Exception#dup does copy the backtrace" # Expected [] to equal ["InitializeException: my exception", " at TMP_13 (...)"]
42
+ fails "Exception#dup does copy the cause" # NoMethodError: undefined method `cause' for #<RuntimeError: the consequence>
43
+ fails "Exception#exception captures an exception into $!" # Expected "RuntimeError" == "" to be truthy but was false
44
+ fails "Exception#full_message contains all the chain of exceptions" # NoMethodError: undefined method `full_message' for #<RuntimeError: last exception>
45
+ fails "Exception#full_message contains cause of exception" # NoMethodError: undefined method `full_message' for #<RuntimeError: main exception>
46
+ fails "Exception#full_message returns formatted string of exception using the same format that is used to print an uncaught exceptions to stderr" # NoMethodError: undefined method `full_message' for #<RuntimeError: Some runtime error>
47
+ fails "Exception#full_message shows the caller if the exception has no backtrace"
48
+ fails "Exception#full_message shows the exception class at the end of the first line of the message when the message contains multiple lines" # NoMethodError: undefined method `full_message' for #<RuntimeError: first line second line>
49
+ fails "Exception#full_message supports :highlight option and adds escape sequences to highlight some strings" # NoMethodError: undefined method `full_message' for #<RuntimeError: Some runtime error>
50
+ fails "Exception#full_message supports :order option and places the error message and the backtrace at the top or the bottom" # NoMethodError: undefined method `full_message' for #<RuntimeError: Some runtime error>
51
+ fails "Exception#set_backtrace raises a TypeError when passed a Symbol"
52
+ fails "Exception#set_backtrace raises a TypeError when the Array contains a Symbol"
53
+ fails "Exception#to_s calls #to_s on the message" # Mock 'message' expected to receive 'to_s' exactly 1 times but received it 2 times
54
+ fails "IOError is a superclass of EOFError"
55
+ fails "Interrupt is a subclass of SignalException" # Expected Exception to equal SignalException
56
+ fails "Interrupt.new returns an instance of interrupt with no message given" # NoMethodError: undefined method `signo' for #<Interrupt: Interrupt>:Interrupt
57
+ fails "Interrupt.new takes an optional message argument" # NoMethodError: undefined method `signo' for #<Interrupt: message>:Interrupt
58
+ fails "KeyError accepts :receiver and :key options" # ArgumentError: no receiver is available
59
+ fails "LocalJumpError#exit_value returns the value given to return" # Expected LocalJumpError but got: Exception (unexpected return)
60
+ fails "LocalJumpError#reason returns 'return' for a return" # Expected LocalJumpError but got: Exception (unexpected return)
61
+ fails "NameError#dup copies the name and receiver" # NoMethodError: undefined method `receiver' for #<NoMethodError: undefined method `foo' for #<MSpecEnv:0x262>>
62
+ fails "NameError#name returns a class variable name as a symbol"
63
+ fails "NameError#receiver returns a class when an undefined class variable is called in a subclass' namespace"
64
+ fails "NameError#receiver returns a class when an undefined constant is called"
65
+ fails "NameError#receiver returns the Object class when an undefined class variable is called"
66
+ fails "NameError#receiver returns the Object class when an undefined constant is called without namespace"
67
+ fails "NameError#receiver returns the object that raised the exception"
68
+ fails "NameError#receiver returns the receiver when raised from #class_variable_get"
69
+ fails "NameError#receiver returns the receiver when raised from #instance_variable_get"
70
+ fails "NameError#to_s raises its own message for an undefined variable" # Expected "undefined method `not_defined' for #<MSpecEnv:0x54e>" =~ /undefined local variable or method `not_defined'/ to be truthy but was nil
71
+ fails "NameError.new accepts a :receiver keyword argument" # ArgumentError: [NameError#initialize] wrong number of arguments(3 for -2)
72
+ fails "NoMethodError#dup copies the name, arguments and receiver" # NoMethodError: undefined method `receiver' for #<NoMethodError: undefined method `foo' for #<Object:0x230>>
73
+ fails "NoMethodError#message uses #name to display the receiver if it is a class or a module" # Expected "undefined method `foo' for #<Class:0x8b870>" == "undefined method `foo' for MyClass:Class" to be truthy but was false
74
+ fails "NoMethodError.new accepts a :receiver keyword argument" # NoMethodError: undefined method `receiver' for #<NoMethodError: msg>
75
+ fails "SignalException can be rescued" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x278>
76
+ fails "SignalException cannot be trapped with Signal.trap" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x278>
77
+ fails "SignalException runs after at_exit" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x278>
78
+ fails "SignalException self-signals for USR1" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x278>
79
+ fails "SignalException#signm returns the signal name" # Expected SignalException but got: NoMethodError (undefined method `kill' for Process)
80
+ fails "SignalException#signo returns the signal number" # Expected SignalException but got: NoMethodError (undefined method `kill' for Process)
81
+ fails "SignalException.new raises an exception for an optional argument with a signal name"
82
+ fails "SignalException.new raises an exception with an invalid first argument type" # Expected ArgumentError but no exception was raised (#<SignalException: #<Object:0x20000>> was returned)
83
+ fails "SignalException.new raises an exception with an invalid signal name"
84
+ fails "SignalException.new raises an exception with an invalid signal number"
85
+ fails "SignalException.new takes a signal name with SIG prefix as the first argument"
86
+ fails "SignalException.new takes a signal name without SIG prefix as the first argument"
87
+ fails "SignalException.new takes a signal number as the first argument"
88
+ fails "SignalException.new takes a signal symbol with SIG prefix as the first argument"
89
+ fails "SignalException.new takes a signal symbol without SIG prefix as the first argument"
90
+ fails "SignalException.new takes an optional message argument with a signal number"
91
+ fails "StopIteration#result returns the method-returned-object from an Enumerator"
92
+ fails "SystemCallError#backtrace is nil if not raised" # Expected ["SystemCallError: message", " from ruby/core/exception/system_call_error_spec.rb:141:5:in `new'", " from corelib/basic_object.rb:119:1:in `$instance_exec'", " from corelib/runtime.js:1729:5:in `Opal.send2'", " from corelib/runtime.js:1719:5:in `Opal.send'", " from mspec/runner/mspec.rb:114:7:in `instance_exec'", " from corelib/runtime.js:1729:5:in `Opal.send2'", " from corelib/runtime.js:1719:5:in `Opal.send'", " from mspec/runner/context.rb:176:34:in `protect'", " from corelib/runtime.js:1518:5:in `Opal.yieldX'", " from corelib/enumerable.rb:27:16:in `$$3'"] == nil to be truthy but was false
93
+ fails "SystemCallError#dup copies the errno" # NoMethodError: undefined method `errno' for #<SystemCallError: message>
94
+ fails "SystemCallError#errno returns nil when no errno given"
95
+ fails "SystemCallError#errno returns the errno given as optional argument to new"
96
+ fails "SystemCallError#message returns the default message when no message is given"
97
+ fails "SystemCallError.=== returns false if errnos different" # NoMethodError: undefined method `+' for Errno
98
+ fails "SystemCallError.=== returns true if errnos same" # Expected false == true to be truthy but was false
99
+ fails "SystemCallError.new accepts an optional custom message preceding the errno"
100
+ fails "SystemCallError.new accepts an optional third argument specifying the location"
101
+ fails "SystemCallError.new accepts single Fixnum argument as errno"
102
+ fails "SystemCallError.new accepts single Integer argument as errno" # NoMethodError: undefined method `errno' for #<SystemCallError: -16777216>
103
+ fails "SystemCallError.new coerces location if it is not a String" # Expected "foo" =~ /@ not_a_string - foo/ to be truthy but was nil
104
+ fails "SystemCallError.new constructs the appropriate Errno class"
105
+ fails "SystemCallError.new converts to Integer if errno is a Complex convertible to Integer" # Expected #<SystemCallError: foo> == #<SystemCallError: foo> to be truthy but was false
106
+ fails "SystemCallError.new converts to Integer if errno is a Float" # Expected #<SystemCallError: foo> == #<SystemCallError: foo> to be truthy but was false
107
+ fails "SystemCallError.new raises RangeError if errno is a Complex not convertible to Integer" # Expected RangeError (/can't convert/) but no exception was raised (#<SystemCallError: foo> was returned)
108
+ fails "SystemCallError.new raises TypeError if errno is not an Integer" # Expected TypeError (/no implicit conversion of String into Integer/) but no exception was raised (#<SystemCallError: foo> was returned)
109
+ fails "SystemCallError.new raises TypeError if message is not a String" # Expected TypeError (/no implicit conversion of Symbol into String/) but no exception was raised (#<SystemCallError: foo> was returned)
110
+ fails "SystemCallError.new requires at least one argument"
111
+ fails "SystemExit sets the exit status and exits silently when raised when subclassed" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x542>
112
+ fails "SystemExit sets the exit status and exits silently when raised" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x542>
113
+ fails "SystemStackError is a subclass of Exception"
114
+ fails "UncaughtThrowError#tag returns the object thrown" # NoMethodError: undefined method `tag' for #<UncaughtThrowError: uncaught throw "abc">:UncaughtThrowError
115
+ fails "rescueing Interrupt raises an Interrupt when sent a signal SIGINT" # NoMethodError: undefined method `kill' for Process
116
+ fails "rescueing SignalException raises a SignalException when sent a signal"
117
+ fails_badly "SystemExit#status returns the exit status"
118
+ fails_badly "SystemExit#success? returns false if the process exited unsuccessfully"
119
+ fails_badly "SystemExit#success? returns true if the process exited successfully"
120
+ end
@@ -0,0 +1,48 @@
1
+ # NOTE: run bin/format-filters after changing this file
2
+ opal_filter "File" do
3
+ fails "File.absolute_path accepts a second argument of a directory from which to resolve the path" # Expected "./ruby/core/file/ruby/core/file/absolute_path_spec.rb" to equal "ruby/core/file/absolute_path_spec.rb"
4
+ fails "File.absolute_path does not expand '~user' to a home directory." # Expected "./ruby/core/file/~user" to equal "ruby/core/file/~user"
5
+ fails "File.absolute_path resolves paths relative to the current working directory" # Expected "./ruby/core/file/hello.txt" to equal "ruby/core/file/hello.txt"
6
+ fails "File.absolute_path? calls #to_path on its argument" # Mock 'path' expected to receive to_path("any_args") exactly 1 times but received it 0 times
7
+ fails "File.absolute_path? does not expand '~' to a home directory." # NoMethodError: undefined method `absolute_path?' for File
8
+ fails "File.absolute_path? does not expand '~user' to a home directory." # NoMethodError: undefined method `absolute_path?' for File
9
+ fails "File.absolute_path? returns false if it's a relative path" # NoMethodError: undefined method `absolute_path?' for File
10
+ fails "File.absolute_path? returns false if it's a tricky relative path" # NoMethodError: undefined method `absolute_path?' for File
11
+ fails "File.absolute_path? returns true if it's an absolute pathname" # NoMethodError: undefined method `absolute_path?' for File
12
+ fails "File.absolute_path? takes into consideration the platform's root" # NoMethodError: undefined method `absolute_path?' for File
13
+ fails "File.expand_path accepts objects that have a #to_path method" # Mock 'path' expected to receive 'to_path' exactly 1 times but received it 0 times
14
+ fails "File.expand_path converts a pathname to an absolute pathname" # Expected "" to equal nil
15
+ fails "File.expand_path converts a pathname to an absolute pathname, Ruby-Talk:18512" # NoMethodError: undefined method `empty?' for nil
16
+ fails "File.expand_path converts a pathname to an absolute pathname, using a complete path" # Expected "." to equal ""
17
+ fails "File.expand_path does not expand ~ENV['USER'] when it's not at the start" # ArgumentError: [Dir.home] wrong number of arguments(1 for 0)
18
+ fails "File.expand_path does not modify a HOME string argument" # ArgumentError: [Dir.home] wrong number of arguments(1 for 0)
19
+ fails "File.expand_path does not modify the string argument" # Expected "a/c" to equal "/a/c"
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
+ 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
+ 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
+ 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
+ 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
+ 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
+ fails "File.expand_path expands a path with multi-byte characters" # Expected "Ångström" to equal "/Ångström"
29
+ fails "File.expand_path expands ~ENV['USER'] to the user's home directory" # Expected "./~elia" to equal "/Users/elia"
30
+ fails "File.expand_path expands ~ENV['USER']/a to a in the user's home directory" # ArgumentError: [Dir.home] wrong number of arguments(1 for 0)
31
+ fails "File.expand_path keeps trailing dots on absolute pathname" # ArgumentError: [Dir.home] wrong number of arguments(1 for 0)
32
+ fails "File.expand_path raises a TypeError if not passed a String type" # NoMethodError: undefined method `split' for 1
33
+ fails "File.expand_path raises an ArgumentError if the path is not valid" # Expected ArgumentError but no exception was raised ("./~a_not_existing_user" was returned)
34
+ fails "File.expand_path raises an Encoding::CompatibilityError if the external encoding is not compatible" # ArgumentError: [Dir.home] wrong number of arguments(1 for 0)
35
+ fails "File.expand_path replaces multiple '/' with a single '/'" # ArgumentError: [Dir.home] wrong number of arguments(1 for 0)
36
+ fails "File.expand_path returns a String in the same encoding as the argument" # NameError: uninitialized constant Encoding::SHIFT_JIS
37
+ fails "File.expand_path returns a String when passed a String subclass" # NameError: uninitialized constant FileSpecs
38
+ fails "File.expand_path when HOME is not set raises an ArgumentError when passed '~' if HOME == ''" # Expected ArgumentError but no exception was raised ("/" was returned)
39
+ fails "File.expand_path with a non-absolute HOME raises an ArgumentError" # Expected ArgumentError (non-absolute home) but no exception was raised ("non-absolute" was returned)
40
+ fails "File.extname for a filename ending with a dot returns '.'" # Expected "" == "." to be truthy but was false
41
+ fails "File.join calls #to_path"
42
+ fails "File.join calls #to_str"
43
+ fails "File.join inserts the separator in between empty strings and arrays"
44
+ fails "File.join raises a TypeError exception when args are nil"
45
+ fails "File.join raises an ArgumentError if passed a recursive array"
46
+ fails "File.join raises errors for null bytes" # Expected ArgumentError but no exception was raised ("\u0000x/metadata.gz" was returned)
47
+ fails "File.join returns a duplicate string when given a single argument"
48
+ end
@@ -0,0 +1,74 @@
1
+ # NOTE: run bin/format-filters after changing this file
2
+ opal_filter "Float" do
3
+ fails "Float constant MAX is 1.7976931348623157e+308"
4
+ fails "Float constant MIN is 2.2250738585072014e-308"
5
+ fails "Float#<=> raises TypeError when #coerce misbehaves" # Expected TypeError (coerce must return [x, y]) but no exception was raised (nil was returned)
6
+ fails "Float#divmod returns an [quotient, modulus] from dividing self by other" # precision errors caused by Math.frexp and Math.ldexp
7
+ fails "Float#inspect emits '-' for -0.0" # Expected "0" == "-0.0" to be truthy but was false
8
+ fails "Float#inspect emits a trailing '.0' for a whole number" # Expected "50" == "50.0" to be truthy but was false
9
+ fails "Float#inspect emits a trailing '.0' for the mantissa in e format" # Expected "100000000000000000000" == "1.0e+20" to be truthy but was false
10
+ fails "Float#inspect encoding returns a String in US-ASCII encoding when Encoding.default_internal is nil" # NoMethodError: undefined method `default_internal' for Encoding
11
+ fails "Float#inspect encoding returns a String in US-ASCII encoding when Encoding.default_internal is not nil" # NoMethodError: undefined method `default_internal' for Encoding
12
+ fails "Float#inspect matches random examples in all ranges" # Expected "4.9247416523566613e-8" == "4.9247416523566613e-08" to be truthy but was false
13
+ fails "Float#inspect matches random examples in human ranges" # Expected "174" == "174.0" to be truthy but was false
14
+ fails "Float#inspect matches random values from divisions" # Expected "0" == "0.0" to be truthy but was false
15
+ fails "Float#inspect returns '0.0' for 0.0" # Expected "0" == "0.0" to be truthy but was false
16
+ fails "Float#inspect uses e format for a negative value with fractional part having 6 significant figures" # Expected "-0.00001" == "-1.0e-05" to be truthy but was false
17
+ fails "Float#inspect uses e format for a negative value with whole part having 17 significant figures" # Expected "-1000000000000000" == "-1.0e+15" to be truthy but was false
18
+ fails "Float#inspect uses e format for a negative value with whole part having 18 significant figures" # Expected "-10000000000000000" == "-1.0e+16" to be truthy but was false
19
+ fails "Float#inspect uses e format for a positive value with fractional part having 6 significant figures" # Expected "0.00001" == "1.0e-05" to be truthy but was false
20
+ fails "Float#inspect uses e format for a positive value with whole part having 17 significant figures" # Expected "1000000000000000" == "1.0e+15" to be truthy but was false
21
+ fails "Float#inspect uses e format for a positive value with whole part having 18 significant figures" # Expected "10000000000000000" == "1.0e+16" to be truthy but was false
22
+ fails "Float#inspect uses non-e format for a negative value with whole part having 15 significant figures" # Expected "-10000000000000" == "-10000000000000.0" to be truthy but was false
23
+ fails "Float#inspect uses non-e format for a negative value with whole part having 16 significant figures" # Expected "-100000000000000" == "-100000000000000.0" to be truthy but was false
24
+ fails "Float#inspect uses non-e format for a positive value with whole part having 15 significant figures" # Expected "10000000000000" == "10000000000000.0" to be truthy but was false
25
+ fails "Float#inspect uses non-e format for a positive value with whole part having 16 significant figures" # Expected "100000000000000" == "100000000000000.0" to be truthy but was false
26
+ fails "Float#negative? on negative zero returns false" # Expected true to be false
27
+ fails "Float#next_float gives the same result for -0.0 as for +0.0" # NoMethodError: undefined method `next_float' for 0
28
+ fails "Float#next_float returns Float::INFINITY for Float::INFINITY" # NoMethodError: undefined method `next_float' for Infinity
29
+ fails "Float#next_float returns NAN if NAN was the receiver"
30
+ fails "Float#next_float returns a float the smallest possible step greater than the receiver"
31
+ fails "Float#next_float returns negative zero when stepping upward from just below zero"
32
+ fails "Float#next_float reverses the effect of prev_float for all Floats except INFINITY and +0.0" # NoMethodError: undefined method `prev_float' for -0.739980680635199
33
+ fails "Float#next_float steps directly between -1.0 and -1.0 + EPSILON/2"
34
+ fails "Float#next_float steps directly between 1.0 and 1.0 + EPSILON"
35
+ fails "Float#next_float steps directly between MAX and INFINITY"
36
+ fails "Float#prev_float gives the same result for -0.0 as for +0.0" # NoMethodError: undefined method `prev_float' for 0
37
+ fails "Float#prev_float returns -Float::INFINITY for -Float::INFINITY" # NoMethodError: undefined method `prev_float' for -Infinity
38
+ fails "Float#prev_float returns NAN if NAN was the receiver"
39
+ fails "Float#prev_float returns a float the smallest possible step smaller than the receiver"
40
+ fails "Float#prev_float returns positive zero when stepping downward from just above zero"
41
+ 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
42
+ fails "Float#prev_float reverses the effect of next_float"
43
+ fails "Float#prev_float steps directly between -1.0 and -1.0 - EPSILON"
44
+ fails "Float#prev_float steps directly between 1.0 and 1.0 - EPSILON/2"
45
+ fails "Float#prev_float steps directly between MAX and INFINITY"
46
+ fails "Float#rationalize returns self as a simplified Rational with no argument" # precision errors caused by Math.frexp and Math.ldexp
47
+ fails "Float#round raise for a non-existent round mode" # TypeError: no implicit conversion of Hash into Integer
48
+ fails "Float#round raises FloatDomainError for exceptional values with a half option" # TypeError: no implicit conversion of Hash into Integer
49
+ fails "Float#round returns big values rounded to nearest" # Expected 0 to have same value and type as 300000000000000000000
50
+ fails "Float#round returns different rounded values depending on the half option" # TypeError: no implicit conversion of Hash into Integer
51
+ fails "Float#round rounds self to an optionally given precision with a half option" # ArgumentError: [Number#round] wrong number of arguments(2 for -1)
52
+ fails "Float#round when 0.0 is given returns 0 for 0 or undefined ndigits" # TypeError: no implicit conversion of Hash into Integer
53
+ fails "Float#round when 0.0 is given returns self for positive ndigits" # Expected "0" == "0.0" to be truthy but was false
54
+ fails "Float#to_i returns self truncated to an Integer"
55
+ fails "Float#to_int returns self truncated to an Integer"
56
+ fails "Float#to_s encoding returns a String in US-ASCII encoding when Encoding.default_internal is nil" # NoMethodError: undefined method `default_internal' for Encoding
57
+ fails "Float#to_s encoding returns a String in US-ASCII encoding when Encoding.default_internal is not nil" # NoMethodError: undefined method `default_internal' for Encoding
58
+ fails "Float#to_s matches random examples in all ranges" # Expected "4.9247416523566613e-8" to equal "4.9247416523566613e-08"
59
+ fails "Float#to_s matches random examples in human ranges" # Expected "174" to equal "174.0"
60
+ fails "Float#to_s matches random values from divisions" # Expected "0" to equal "0.0"
61
+ fails "Float#to_s uses e format for a negative value with fractional part having 6 significant figures"
62
+ fails "Float#to_s uses e format for a negative value with whole part having 17 significant figures" # Expected "-1000000000000000" to equal "-1.0e+15"
63
+ fails "Float#to_s uses e format for a negative value with whole part having 18 significant figures"
64
+ fails "Float#to_s uses e format for a positive value with fractional part having 6 significant figures"
65
+ fails "Float#to_s uses e format for a positive value with whole part having 17 significant figures" # Expected "1000000000000000" to equal "1.0e+15"
66
+ fails "Float#to_s uses e format for a positive value with whole part having 18 significant figures"
67
+ fails "Float#to_s uses non-e format for a negative value with whole part having 15 significant figures"
68
+ 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
+ fails "Float#to_s uses non-e format for a positive value with whole part having 15 significant figures"
71
+ 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
+ fails "Float#truncate returns self truncated to an Integer"
74
+ end
@@ -0,0 +1,60 @@
1
+ # NOTE: run bin/format-filters after changing this file
2
+ opal_filter "Hash" do
3
+ fails "Hash#== compares keys with eql? semantics" # spec relies on integer and float being different
4
+ fails "Hash#== computes equality for complex recursive hashes"
5
+ fails "Hash#== computes equality for recursive hashes & arrays"
6
+ fails "Hash#[] compares keys with eql? semantics" # spec relies on integer and float being different
7
+ fails "Hash#[] does not create copies of the immediate default value" # spec uses mutable string
8
+ fails "Hash#[] does not dispatch to hash for Boolean, Integer, Float, String, or Symbol" # NoMethodError: undefined method `insert' for "rubyexe.rb"
9
+ fails "Hash#[]= does not dispatch to hash for Boolean, Integer, Float, String, or Symbol" # NoMethodError: undefined method `insert' for "rubyexe.rb"
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
+ fails "Hash#compare_by_identity gives different identity for string literals" # Expected [2] to equal [1, 2]
12
+ fails "Hash#deconstruct_keys ignores argument" # NoMethodError: undefined method `deconstruct_keys' for {"a"=>1, "b"=>2}
13
+ fails "Hash#deconstruct_keys requires one argument" # Expected ArgumentError (/wrong number of arguments \(given 0, expected 1\)/) but got: NoMethodError (undefined method `deconstruct_keys' for {"a"=>1})
14
+ fails "Hash#deconstruct_keys returns self" # NoMethodError: undefined method `deconstruct_keys' for {"a"=>1, "b"=>2}
15
+ fails "Hash#delete allows removing a key while iterating" # Exception: Cannot read property '$$is_string' of undefined
16
+ 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)
17
+ 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)
18
+ 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)
19
+ 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)
20
+ fails "Hash#eql? compares keys with eql? semantics" # spec relies on integer and float being different
21
+ fails "Hash#eql? computes equality for complex recursive hashes"
22
+ fails "Hash#eql? computes equality for recursive hashes & arrays"
23
+ fails "Hash#except always returns a Hash without a default" # NoMethodError: undefined method `except' for {"bar"=>12, "foo"=>42}
24
+ fails "Hash#except ignores keys not present in the original hash" # NoMethodError: undefined method `except' for {"a"=>1, "b"=>2, "c"=>3}
25
+ fails "Hash#except returns a hash without the requested subset" # NoMethodError: undefined method `except' for {"a"=>1, "b"=>2, "c"=>3}
26
+ fails "Hash#except returns a new duplicate hash without arguments" # NoMethodError: undefined method `except' for {"a"=>1, "b"=>2, "c"=>3}
27
+ fails "Hash#inspect calls #to_s on the object returned from #inspect if the Object isn't a String" # Expected "{\"a\"=>abc}" to equal "{:a=>abc}"
28
+ fails "Hash#inspect does not call #to_s on a String returned from #inspect" # Expected "{\"a\"=>\"abc\"}" to equal "{:a=>\"abc\"}"
29
+ fails "Hash#inspect does not call #to_str on the object returned from #inspect when it is not a String" # Expected "{\"a\"=>#<MockObject:0x30638>}" to match /^\{:a=>#<MockObject:0x[0-9a-f]+>\}$/
30
+ fails "Hash#inspect 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
31
+ fails "Hash#invert compares new keys with eql? semantics" # spec relies on integer and float being different
32
+ fails "Hash#merge accepts multiple hashes" # ArgumentError: [Hash#merge] wrong number of arguments(3 for 1)
33
+ fails "Hash#merge accepts zero arguments and returns a copy of self" # ArgumentError: [Hash#merge] wrong number of arguments(0 for 1)
34
+ fails "Hash#merge! accepts multiple hashes" # ArgumentError: [Hash#merge!] wrong number of arguments(3 for 1)
35
+ fails "Hash#merge! accepts zero arguments" # ArgumentError: [Hash#merge!] wrong number of arguments(0 for 1)
36
+ fails "Hash#rehash removes duplicate keys" # Expected 2 to equal 1
37
+ fails "Hash#shift allows shifting entries while iterating" # Exception: Cannot read property '$$is_string' of undefined
38
+ fails "Hash#store does not dispatch to hash for Boolean, Integer, Float, String, or Symbol" # NoMethodError: undefined method `insert' for "rubyexe.rb"
39
+ fails "Hash#store keeps the existing String key in the hash if there is a matching one" # Expected "foo" not to be identical to "foo"
40
+ fails "Hash#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 ({"a"=>1} was returned)
41
+ fails "Hash#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 ({"a"=>1, "b"=>2} was returned)
42
+ fails "Hash#to_h with block raises TypeError if block returns something other than Array" # Expected TypeError (/wrong element type String/) but no exception was raised ({"a"=>1, "b"=>2} was returned)
43
+ fails "Hash#to_proc the returned proc has an arity of 1" # Expected -1 == 1 to be truthy but was false
44
+ fails "Hash#to_proc the returned proc is a lambda" # Expected #<Proc:0x231fa>.lambda? to be truthy but was false
45
+ fails "Hash#to_s calls #to_s on the object returned from #inspect if the Object isn't a String" # Expected "{\"a\"=>abc}" to equal "{:a=>abc}"
46
+ fails "Hash#to_s does not call #to_s on a String returned from #inspect" # Expected "{\"a\"=>\"abc\"}" to equal "{:a=>\"abc\"}"
47
+ 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]+>\}$/
48
+ 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
49
+ 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}
50
+ fails "Hash#transform_keys! returns the processed keys if we broke from the block" # Expected {"c"=>1, "d"=>4} to equal {"b"=>1, "c"=>2}
51
+ fails "Hash#update accepts multiple hashes" # ArgumentError: [Hash#merge!] wrong number of arguments(3 for 1)
52
+ fails "Hash#update accepts zero arguments" # ArgumentError: [Hash#merge!] wrong number of arguments(0 for 1)
53
+ fails "Hash.[] raises for elements that are not arrays" # Expected ArgumentError but no exception was raised (nil was returned)
54
+ fails "Hash.ruby2_keywords_hash raises TypeError for non-Hash" # Expected TypeError but got: NoMethodError (undefined method `ruby2_keywords_hash' for Hash)
55
+ fails "Hash.ruby2_keywords_hash returns a copy of a Hash and marks the copy as a keywords Hash" # NoMethodError: undefined method `ruby2_keywords_hash' for Hash
56
+ fails "Hash.ruby2_keywords_hash returns an instance of the subclass if called on an instance of a subclass of Hash" # NoMethodError: undefined method `ruby2_keywords_hash' for Hash
57
+ fails "Hash.ruby2_keywords_hash? raises TypeError for non-Hash" # Expected TypeError but got: NoMethodError (undefined method `ruby2_keywords_hash?' for Hash)
58
+ fails "Hash.ruby2_keywords_hash? returns false if the Hash is not a keywords Hash" # NoMethodError: undefined method `ruby2_keywords_hash?' for Hash
59
+ fails "Hash.ruby2_keywords_hash? returns true if the Hash is a keywords Hash marked by Module#ruby2_keywords" # NoMethodError: undefined method `ruby2_keywords' for #<Class:0x57648>
60
+ end
@@ -0,0 +1,78 @@
1
+ # NOTE: run bin/format-filters after changing this file
2
+ opal_filter "Integer" do
3
+ fails "A singleton class raises a TypeError for Integer's" # Expected TypeError but no exception was raised (#<Class:#<Number:0x3>> was returned)
4
+ fails "Bignum is deprecated" # NameError: uninitialized constant Bignum
5
+ fails "Bignum is unified into Integer" # NameError: uninitialized constant Bignum
6
+ fails "Fixnum is deprecated" # Expected warning to match: /constant ::Fixnum is deprecated/ but got: ""
7
+ fails "Fixnum is unified into Integer" # Expected Number to be identical to Integer
8
+ fails "Integer is the class of both small and large integers" # Expected Number to be identical to Integer
9
+ fails "Integer#& fixnum raises a TypeError when passed a Float" # Expected TypeError but no exception was raised (3 was returned)
10
+ 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: ""
11
+ fails "Integer#** fixnum raises a ZeroDivisionError for 0 ** -1" # Expected ZeroDivisionError but no exception was raised (Infinity was returned)
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
+ fails "Integer#** fixnum returns self raised to the given power" # Exception: Maximum call stack size exceeded
14
+ fails "Integer#/ fixnum coerces fixnum and return self divided by other" # Expected 1.0842021724855044e-19 to equal 0
15
+ 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
+ fails "Integer#/ fixnum returns result the same class as the argument" # Expected 1.5 to equal 1
17
+ fails "Integer#/ fixnum returns self divided by the given argument" # Expected 1.5 to equal 1
18
+ fails "Integer#/ fixnum supports dividing negative numbers" # Expected -0.1 to equal -1
19
+ fails "Integer#<< (with n << m) fixnum calls #to_int to convert the argument to an Integer" # Expected 3 == 0 to be truthy but was false
20
+ fails "Integer#<< (with n << m) fixnum returns -1 when n < 0, m < 0 and n > -(2**-m)" # Expected -7 to equal -1
21
+ fails "Integer#<< (with n << m) fixnum returns 0 when n > 0, m < 0 and n < 2**-m" # Expected 7 to equal 0
22
+ fails "Integer#>> (with n >> m) fixnum calls #to_int to convert the argument to an Integer" # Expected 8 == 0 to be truthy but was false
23
+ fails "Integer#>> (with n >> m) fixnum returns -1 when n < 0, m > 0 and n > -(2**m)" # Expected -7 to equal -1
24
+ fails "Integer#>> (with n >> m) fixnum returns 0 when n > 0, m > 0 and n < 2**m" # Expected 7 to equal 0
25
+ fails "Integer#[] fixnum when index and length passed ensures n[i, len] equals to (n >> i) & ((1 << len) - 1)" # ArgumentError: [Number#[]] wrong number of arguments(2 for 1)
26
+ fails "Integer#[] fixnum when index and length passed ignores negative length" # ArgumentError: [Number#[]] wrong number of arguments(2 for 1)
27
+ fails "Integer#[] fixnum when index and length passed moves start position to the most significant bits when negative index passed" # ArgumentError: [Number#[]] wrong number of arguments(2 for 1)
28
+ fails "Integer#[] fixnum when index and length passed returns specified number of bits from specified position" # ArgumentError: [Number#[]] wrong number of arguments(2 for 1)
29
+ fails "Integer#[] fixnum when range passed ensures n[i..] equals to (n >> i)" # Opal::SyntaxError: undefined method `type' for nil
30
+ fails "Integer#[] fixnum when range passed ensures n[i..j] equals to (n >> i) & ((1 << (j - i + 1)) - 1)" # TypeError: no implicit conversion of Range into Integer
31
+ fails "Integer#[] fixnum when range passed ignores upper boundary smaller than lower boundary" # TypeError: no implicit conversion of Range into Integer
32
+ fails "Integer#[] fixnum when range passed moves lower boundary to the most significant bits when negative value passed" # ArgumentError: [Number#[]] wrong number of arguments(2 for 1)
33
+ fails "Integer#[] fixnum when range passed raises FloatDomainError if any boundary is infinity" # Expected FloatDomainError (/Infinity/) but got: TypeError (no implicit conversion of Range into Integer)
34
+ fails "Integer#[] fixnum when range passed returns bits specified by range" # TypeError: no implicit conversion of Range into Integer
35
+ fails "Integer#[] fixnum when range passed when passed (..i) raises ArgumentError if any of i bit equals 1" # Expected ArgumentError (/The beginless range for Integer#\[\] results in infinity/) but got: Opal::SyntaxError (undefined method `type' for nil)
36
+ fails "Integer#[] fixnum when range passed when passed (..i) returns 0 if all i bits equal 0" # Opal::SyntaxError: undefined method `type' for nil
37
+ fails "Integer#^ fixnum raises a TypeError when passed a Float" # Expected TypeError but no exception was raised (0 was returned)
38
+ fails "Integer#^ fixnum returns self bitwise EXCLUSIVE OR other" # Expected 5 to equal 9223372041149743000
39
+ fails "Integer#chr with an encoding argument raises RangeError if self is invalid as a codepoint in the specified encoding"
40
+ fails "Integer#chr with an encoding argument raises a RangeError if self is too large" # Expected RangeError but no exception was raised ("膀" was returned)
41
+ fails "Integer#chr with an encoding argument raises a RangeError is self is less than 0"
42
+ fails "Integer#chr with an encoding argument returns a String encoding self interpreted as a codepoint in the CESU-8 encoding" # NameError: uninitialized constant Encoding::CESU_8
43
+ fails "Integer#chr with an encoding argument returns a String encoding self interpreted as a codepoint in the specified encoding"
44
+ fails "Integer#chr with an encoding argument returns a String with the specified encoding"
45
+ fails "Integer#chr with an encoding argument returns a new String for each call"
46
+ fails "Integer#chr without argument raises a RangeError is self is less than 0"
47
+ fails "Integer#chr without argument returns a new String for each call"
48
+ 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 a String containing self interpreted as a byte"
50
+ fails "Integer#chr without argument when Encoding.default_internal is nil and self is between 128 and 255 (inclusive) returns a binary String" # Expected #<Encoding:UTF-16LE> to equal #<Encoding:ASCII-8BIT (dummy)>
51
+ fails "Integer#chr without argument when Encoding.default_internal is nil and self is between 128 and 255 (inclusive) returns an ASCII-8BIT String"
52
+ fails "Integer#chr without argument when Encoding.default_internal is nil raises a RangeError is self is greater than 255"
53
+ 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"
54
+ 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"
55
+ 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"
56
+ 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
57
+ 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"
58
+ 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"
59
+ 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"
60
+ 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"
61
+ fails "Integer#coerce bigdecimal produces Floats" # Exception: other.$respond_to? is not a function
62
+ fails "Integer#coerce fixnum raises a TypeError when given an Object that does not respond to #to_f" # depends on the difference between string/symbol
63
+ fails "Integer#coerce fixnum when given a Fixnum returns an array containing two Fixnums" # Expected [Number, Number] == [Integer, Integer] to be truthy but was false
64
+ fails "Integer#div fixnum calls #coerce and #div if argument responds to #coerce" # Mock 'x' expected to receive div(#<MockObject:0x16c22>) exactly 1 times but received it 0 times
65
+ fails "Integer#divmod fixnum raises a TypeError when given a non-Integer" # NoMethodError: undefined method `nan?' for #<MockObject:0x1df78>
66
+ fails "Integer#odd? fixnum returns true when self is an odd number" # Expected false to be true
67
+ 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: ""
68
+ fails "Integer#pow one argument is passed fixnum returns self raised to the given power" # Exception: Maximum call stack size exceeded
69
+ 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)
70
+ fails "Integer#round raises ArgumentError for an unknown rounding mode" # ArgumentError: [Number#round] wrong number of arguments(2 for -1)
71
+ fails "Integer#round raises a RangeError when passed a big negative value" # Expected RangeError but no exception was raised (0 was returned)
72
+ fails "Integer#round returns different rounded values depending on the half option" # ArgumentError: [Number#round] wrong number of arguments(2 for -1)
73
+ fails "Integer#round returns itself if passed a positive precision and the half option" # ArgumentError: [Number#round] wrong number of arguments(2 for -1)
74
+ fails "Integer#round returns itself rounded to nearest if passed a negative value" # Expected NaN to have same value and type as 300
75
+ fails "Integer#| fixnum raises a TypeError when passed a Float" # Expected TypeError but no exception was raised (3 was returned)
76
+ fails "Integer#| fixnum returns self bitwise OR other" # Expected 65535 to equal 9223372036854841000
77
+ fails "Integer.sqrt returns the integer square root of the argument" # Number overflow, 10**400
78
+ end
@@ -0,0 +1,9 @@
1
+ # NOTE: run bin/format-filters after changing this file
2
+ opal_filter "IO" do
3
+ fails "IO::EAGAINWaitReadable combines Errno::EAGAIN and IO::WaitReadable" # NameError: uninitialized constant IO::EAGAINWaitReadable
4
+ fails "IO::EAGAINWaitReadable is the same as IO::EWOULDBLOCKWaitReadable if Errno::EAGAIN is the same as Errno::EWOULDBLOCK" # NameError: uninitialized constant Errno::EAGAIN
5
+ fails "IO::EAGAINWaitWritable combines Errno::EAGAIN and IO::WaitWritable" # NameError: uninitialized constant IO::EAGAINWaitWritable
6
+ fails "IO::EAGAINWaitWritable is the same as IO::EWOULDBLOCKWaitWritable if Errno::EAGAIN is the same as Errno::EWOULDBLOCK" # NameError: uninitialized constant Errno::EAGAIN
7
+ fails "IO::EWOULDBLOCKWaitReadable combines Errno::EWOULDBLOCK and IO::WaitReadable" # NameError: uninitialized constant IO::EWOULDBLOCKWaitReadable
8
+ fails "IO::EWOULDBLOCKWaitWritable combines Errno::EWOULDBLOCK and IO::WaitWritable" # NameError: uninitialized constant IO::EWOULDBLOCKWaitWritable
9
+ end
@@ -0,0 +1,401 @@
1
+ # NOTE: run bin/format-filters after changing this file
2
+ opal_filter "Kernel" do
3
+ fails "Kernel#=== does not call #object_id nor #equal? but still returns true for #== or #=== on the same object" # Mock '#<Object:0x37dd4>' expected to receive 'object_id' exactly 0 times but received it 2 times
4
+ fails "Kernel#=~ returns nil matching any object"
5
+ fails "Kernel#Float for hexadecimal literals with binary exponent allows embedded _ in a number on either side of the P"
6
+ fails "Kernel#Float for hexadecimal literals with binary exponent allows embedded _ in a number on either side of the p"
7
+ fails "Kernel#Float for hexadecimal literals with binary exponent allows hexadecimal points on the left side of the 'P'"
8
+ fails "Kernel#Float for hexadecimal literals with binary exponent allows hexadecimal points on the left side of the 'p'"
9
+ fails "Kernel#Float for hexadecimal literals with binary exponent interprets the exponent (on the right of 'P') in decimal"
10
+ fails "Kernel#Float for hexadecimal literals with binary exponent interprets the exponent (on the right of 'p') in decimal"
11
+ fails "Kernel#Float for hexadecimal literals with binary exponent interprets the fractional part (on the left side of 'P') in hexadecimal"
12
+ fails "Kernel#Float for hexadecimal literals with binary exponent interprets the fractional part (on the left side of 'p') in hexadecimal"
13
+ fails "Kernel#Float for hexadecimal literals with binary exponent returns 0 for '0x1P-10000'"
14
+ fails "Kernel#Float for hexadecimal literals with binary exponent returns 0 for '0x1p-10000'"
15
+ fails "Kernel#Float for hexadecimal literals with binary exponent returns Infinity for '0x1P10000'"
16
+ fails "Kernel#Float for hexadecimal literals with binary exponent returns Infinity for '0x1p10000'"
17
+ fails "Kernel#Float when passed exception: false and invalid input swallows an error" # ArgumentError: [Object#Float] wrong number of arguments(2 for 1)
18
+ fails "Kernel#Float when passed exception: false and nil swallows it" # ArgumentError: [Object#Float] wrong number of arguments(2 for 1)
19
+ fails "Kernel#Float when passed exception: false and valid input returns a Float number" # ArgumentError: [Object#Float] wrong number of arguments(2 for 1)
20
+ fails "Kernel#Integer raises a TypeError when to_int returns not-an-Integer object and to_i returns nil" # Expected TypeError but no exception was raised ("1" was returned)
21
+ fails "Kernel#Integer return a result of to_i when to_int does not return an Integer" # Expected "1" == 42 to be truthy but was false
22
+ fails "Kernel#Integer when passed exception: false and an argument that contains a period swallows an error" # TypeError: no implicit conversion of Hash into Integer
23
+ fails "Kernel#Integer when passed exception: false and an empty string swallows an error" # TypeError: no implicit conversion of Hash into Integer
24
+ fails "Kernel#Integer when passed exception: false and invalid argument swallows an error" # ArgumentError: [MSpecEnv#Integer] wrong number of arguments(3 for -2)
25
+ fails "Kernel#Integer when passed exception: false and multiple leading -s swallows an error" # TypeError: no implicit conversion of Hash into Integer
26
+ fails "Kernel#Integer when passed exception: false and multiple trailing -s swallows an error" # TypeError: no implicit conversion of Hash into Integer
27
+ fails "Kernel#Integer when passed exception: false and no to_int or to_i methods exist swallows an error" # ArgumentError: base specified for non string value
28
+ fails "Kernel#Integer when passed exception: false and passed Infinity swallows an error" # ArgumentError: base specified for non string value
29
+ fails "Kernel#Integer when passed exception: false and passed NaN swallows an error" # ArgumentError: base specified for non string value
30
+ fails "Kernel#Integer when passed exception: false and passed a String that can't be converted to an Integer swallows an error" # TypeError: no implicit conversion of Hash into Integer
31
+ fails "Kernel#Integer when passed exception: false and passed a String that contains numbers normally parses it and returns an Integer" # TypeError: no implicit conversion of Hash into Integer
32
+ fails "Kernel#Integer when passed exception: false and passed nil swallows an error" # ArgumentError: base specified for non string value
33
+ fails "Kernel#Integer when passed exception: false and to_i returns a value that is not an Integer swallows an error" # ArgumentError: base specified for non string value
34
+ fails "Kernel#Integer when passed exception: false and to_int returns nil and no to_i exists swallows an error" # ArgumentError: base specified for non string value
35
+ fails "Kernel#Integer when passed exception: false and valid argument returns an Integer number" # ArgumentError: [MSpecEnv#Integer] wrong number of arguments(3 for -2)
36
+ fails "Kernel#Pathname returns same argument when called with a pathname argument" # Expected foo.equal? foo to be truthy but was false
37
+ fails "Kernel#String calls #to_s if #respond_to?(:to_s) returns true" # TypeError: no implicit conversion of MockObject into String
38
+ fails "Kernel#String raises a TypeError if #to_s is not defined, even though #respond_to?(:to_s) returns true"
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
+ 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
+ fails "Kernel#autoload calls main.require(path) to load the file" # NameError: uninitialized constant TOPLEVEL_BINDING
45
+ fails "Kernel#autoload can autoload in instance_eval" # NameError: uninitialized constant KSAutoloadD
46
+ fails "Kernel#autoload is a private method" # Expected Kernel to have private instance method 'autoload' but it does not
47
+ fails "Kernel#autoload loads the file when the constant is accessed" # NameError: uninitialized constant KSAutoloadB
48
+ fails "Kernel#autoload registers a file to load the first time the named constant is accessed" # NoMethodError: undefined method `autoload?' for #<MSpecEnv:0x7849c>
49
+ fails "Kernel#autoload sets the autoload constant in Object's constant table" # Expected Object to have constant 'KSAutoloadA' but it does not
50
+ fails "Kernel#autoload when Object is frozen raises a FrozenError before defining the constant" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x7849c>
51
+ fails "Kernel#autoload when called from included module's method setups the autoload on the included module" # NoMethodError: undefined method `autoload?' for KernelSpecs::AutoloadMethod
52
+ 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
53
+ fails "Kernel#autoload when called from included module's method the autoload relative to the included module works" # NameError: uninitialized constant KernelSpecs::AutoloadMethod::AutoloadFromIncludedModule
54
+ fails "Kernel#autoload? is a private method" # Expected Kernel to have private instance method 'autoload?' but it does not
55
+ fails "Kernel#autoload? returns nil if no file has been registered for a constant" # NoMethodError: undefined method `autoload?' for #<MSpecEnv:0x7849c>
56
+ fails "Kernel#autoload? returns the name of the file that will be autoloaded" # NoMethodError: undefined method `autoload?' for #<MSpecEnv:0x7849c>
57
+ fails "Kernel#caller is a private method" # Expected Kernel to have private instance method 'caller' but it does not
58
+ fails "Kernel#caller returns an Array of caller locations using a custom offset" # Expected "ruby/core/kernel/fixtures/caller.rb:4" to match /runner\/mspec.rb/
59
+ fails "Kernel#caller returns an Array of caller locations using a range" # NoMethodError: undefined method `+' for 1..1
60
+ fails "Kernel#caller returns an Array with the block given to #at_exit at the base of the stack" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0xe208>
61
+ fails "Kernel#caller returns the locations as String instances" # Expected "corelib/runtime.js:1675" to include "ruby/core/kernel/caller_spec.rb:32:in"
62
+ fails "Kernel#caller works with endless ranges" # Opal::SyntaxError: undefined method `type' for nil
63
+ 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
+ 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
+ fails "Kernel#clone uses the internal allocator and does not call #allocate" # RuntimeError: allocate should not be called
68
+ 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
+ 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
+ fails "Kernel#eval allows a binding to be captured inside an eval"
73
+ fails "Kernel#eval allows creating a new class in a binding created by #eval"
74
+ fails "Kernel#eval allows creating a new class in a binding"
75
+ fails "Kernel#eval can be aliased"
76
+ fails "Kernel#eval does not alter the value of __FILE__ in the binding"
77
+ fails "Kernel#eval does not make Proc locals visible to evaluated code"
78
+ fails "Kernel#eval does not share locals across eval scopes"
79
+ fails "Kernel#eval doesn't accept a Proc object as a binding"
80
+ fails "Kernel#eval evaluates string with given filename and negative linenumber" # NameError: uninitialized constant TOPLEVEL_BINDING
81
+ fails "Kernel#eval finds a local in an enclosing scope"
82
+ fails "Kernel#eval finds locals in a nested eval"
83
+ fails "Kernel#eval includes file and line information in syntax error"
84
+ fails "Kernel#eval raises a LocalJumpError if there is no lambda-style closure in the chain"
85
+ fails "Kernel#eval unwinds through a Proc-style closure and returns from a lambda-style closure in the closure chain"
86
+ fails "Kernel#eval updates a local in a scope above a surrounding block scope"
87
+ fails "Kernel#eval updates a local in a scope above when modified in a nested block scope"
88
+ fails "Kernel#eval updates a local in a surrounding block scope"
89
+ fails "Kernel#eval updates a local in an enclosing scope"
90
+ fails "Kernel#eval uses (eval) filename if none is provided" # NoMethodError: undefined method `binding' for #<MSpecEnv:0x50788>
91
+ fails "Kernel#eval uses the filename of the binding if none is provided"
92
+ fails "Kernel#eval uses the same scope for local variables when given the same binding"
93
+ 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
94
+ 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
95
+ fails "Kernel#eval with a magic encoding comment allows a shebang line and some spaces before the magic encoding comment" # Opal::SyntaxError: unexpected token $end
96
+ fails "Kernel#eval with a magic encoding comment allows a shebang line before the magic encoding comment" # Opal::SyntaxError: unexpected token $end
97
+ fails "Kernel#eval with a magic encoding comment allows an emacs-style magic comment encoding" # Opal::SyntaxError: unexpected token $end
98
+ fails "Kernel#eval with a magic encoding comment allows spaces before the magic encoding comment" # Opal::SyntaxError: unexpected token $end
99
+ fails "Kernel#eval with a magic encoding comment ignores the frozen_string_literal magic comment if it appears after a token and warns if $VERBOSE is true" # Expected warning to match: /warning: `frozen_string_literal' is ignored after any tokens/ but got: ""
100
+ fails "Kernel#eval with a magic encoding comment ignores the magic encoding comment if it is after a frozen_string_literal magic comment" # Opal::SyntaxError: unexpected token $end
101
+ fails "Kernel#eval with a magic encoding comment uses the magic comment encoding for parsing constants" # Opal::SyntaxError: unexpected token $end
102
+ fails "Kernel#eval with a magic encoding comment uses the magic comment encoding for the encoding of literal strings" # Expected #<Encoding:UTF-16LE> to equal #<Encoding:UTF-8>
103
+ fails "Kernel#extend does not calls append_features on arguments metaclass"
104
+ fails "Kernel#extend raises an ArgumentError when no arguments given"
105
+ fails "Kernel#fail accepts an Object with an exception method returning an Exception" # TypeError: exception class/object expected
106
+ fails "Kernel#freeze freezes an object's singleton class" # Expected false == true to be truthy but was false
107
+ fails "Kernel#initialize_copy does nothing if the argument is the same as the receiver" # Expected nil.equal? #<Object:0x590> to be truthy but was false
108
+ fails "Kernel#initialize_copy raises FrozenError if the receiver is frozen" # Expected FrozenError but no exception was raised (nil was returned)
109
+ fails "Kernel#initialize_copy raises TypeError if the objects are of different class" # Expected TypeError (initialize_copy should take same class object) but no exception was raised (nil was returned)
110
+ fails "Kernel#inspect does not call #to_s if it is defined"
111
+ fails "Kernel#instance_variables immediate values returns the correct array if an instance variable is added"
112
+ fails "Kernel#is_a? does not take into account `class` method overriding" # TypeError: can't define singleton
113
+ fails "Kernel#is_a? returns true if given a Module that object has been extended with" # Requires string mutability
114
+ fails "Kernel#kind_of? does not take into account `class` method overriding" # TypeError: can't define singleton
115
+ fails "Kernel#kind_of? returns true if given a Module that object has been extended with" # Requires string mutability
116
+ fails "Kernel#local_variables contains locals as they are added"
117
+ fails "Kernel#local_variables includes only unique variable names" # NoMethodError: undefined method `local_variables' for #<MSpecEnv:0x476>
118
+ fails "Kernel#local_variables is accessible from bindings"
119
+ fails "Kernel#local_variables is accessible in eval"
120
+ fails "Kernel#method can be called even if we only repond_to_missing? method, true"
121
+ fails "Kernel#method returns a method object if we repond_to_missing? method"
122
+ fails "Kernel#method will see an alias of the original method as == when in a derived class"
123
+ fails "Kernel#methods does not return private singleton methods defined in 'class << self'"
124
+ fails "Kernel#object_id returns a different value for two Bignum literals"
125
+ fails "Kernel#object_id returns a different value for two String literals"
126
+ fails "Kernel#p flushes output if receiver is a File"
127
+ fails "Kernel#p is not affected by setting $\\, $/ or $,"
128
+ fails "Kernel#pp lazily loads the 'pp' library and delegates the call to that library" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x4f28>
129
+ fails "Kernel#proc uses the implicit block from an enclosing method"
130
+ fails "Kernel#public_method changes the method called for super on a target aliased method"
131
+ fails "Kernel#public_method raises a NameError if we only repond_to_missing? method, true"
132
+ fails "Kernel#public_method returns a method object for a valid method"
133
+ fails "Kernel#public_method returns a method object for a valid singleton method"
134
+ fails "Kernel#public_method returns a method object if we repond_to_missing? method"
135
+ fails "Kernel#public_methods returns a list of names without protected accessible methods in the object"
136
+ fails "Kernel#public_methods when passed false returns a list of public methods in without its ancestors"
137
+ fails "Kernel#public_methods when passed nil returns a list of public methods in without its ancestors"
138
+ fails "Kernel#public_send raises a TypeError if the method name is not a string or symbol" # NoMethodError: undefined method `' for SendSpecs
139
+ fails "Kernel#puts delegates to $stdout.puts"
140
+ fails "Kernel#raise passes no arguments to the constructor when given only an exception class" # Expected #<Class:0x4c8> but got: ArgumentError ([#initialize] wrong number of arguments(1 for 0))
141
+ fails "Kernel#raise raises RuntimeError if no exception class is given" # RuntimeError: RuntimeError
142
+ fails "Kernel#raise re-raises a previously rescued exception without overwriting the backtrace" # Expected "RuntimeError: raised" to include "ruby/shared/kernel/raise.rb:65:"
143
+ fails "Kernel#respond_to? throws a type error if argument can't be coerced into a Symbol"
144
+ fails "Kernel#respond_to_missing? causes #respond_to? to return false if called and returning nil"
145
+ fails "Kernel#respond_to_missing? causes #respond_to? to return true if called and not returning false"
146
+ fails "Kernel#send raises a TypeError if the method name is not a string or symbol" # NoMethodError: undefined method `' for SendSpecs
147
+ fails "Kernel#singleton_class raises TypeError for Fixnum"
148
+ fails "Kernel#singleton_class raises TypeError for Integer" # Expected TypeError but no exception was raised (#<Class:#<Number:0xf7>> was returned)
149
+ fails "Kernel#singleton_class raises TypeError for Symbol"
150
+ fails "Kernel#singleton_method find a method defined on the singleton class" # NoMethodError: undefined method `singleton_method' for #<Object:0x39d20>
151
+ fails "Kernel#singleton_method only looks at singleton methods and not at methods in the class" # Expected NoMethodError to equal NameError
152
+ fails "Kernel#singleton_method raises a NameError if there is no such method" # Expected NoMethodError to equal NameError
153
+ fails "Kernel#singleton_method returns a Method which can be called" # NoMethodError: undefined method `singleton_method' for #<Object:0x39d1a>
154
+ fails "Kernel#singleton_methods when not passed an argument does not return any included methods for a class including a module"
155
+ fails "Kernel#singleton_methods when not passed an argument does not return any included methods for a module including a module"
156
+ fails "Kernel#singleton_methods when not passed an argument does not return private singleton methods for an object extended with a module including a module" # NoMethodError: undefined method `singleton_methods' for #<MockObject:0x104d6>
157
+ fails "Kernel#singleton_methods when not passed an argument for a module does not return methods in a module prepended to Module itself" # NoMethodError: undefined method `singleton_methods' for SingletonMethodsSpecs::SelfExtending
158
+ fails "Kernel#singleton_methods when not passed an argument returns a unique list for a subclass including a module"
159
+ fails "Kernel#singleton_methods when not passed an argument returns a unique list for a subclass"
160
+ fails "Kernel#singleton_methods when not passed an argument returns a unique list for an object extended with a module"
161
+ fails "Kernel#singleton_methods when not passed an argument returns an empty Array for an object with no singleton methods"
162
+ fails "Kernel#singleton_methods when not passed an argument returns the names of class methods for a class"
163
+ fails "Kernel#singleton_methods when not passed an argument returns the names of inherited singleton methods for a class extended with a module"
164
+ fails "Kernel#singleton_methods when not passed an argument returns the names of inherited singleton methods for a subclass including a module"
165
+ fails "Kernel#singleton_methods when not passed an argument returns the names of inherited singleton methods for a subclass of a class including a module"
166
+ fails "Kernel#singleton_methods when not passed an argument returns the names of inherited singleton methods for a subclass of a class that includes a module, where the subclass also includes a module"
167
+ fails "Kernel#singleton_methods when not passed an argument returns the names of inherited singleton methods for a subclass"
168
+ fails "Kernel#singleton_methods when not passed an argument returns the names of module methods for a module"
169
+ 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>
170
+ 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>
171
+ 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>
172
+ 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"
173
+ fails "Kernel#singleton_methods when not passed an argument returns the names of singleton methods for an object extented with a module"
174
+ fails "Kernel#singleton_methods when not passed an argument returns the names of singleton methods for an object extented with two modules"
175
+ fails "Kernel#singleton_methods when not passed an argument returns the names of singleton methods for an object"
176
+ fails "Kernel#singleton_methods when passed false does not return any included methods for a class including a module"
177
+ fails "Kernel#singleton_methods when passed false does not return any included methods for a module including a module"
178
+ fails "Kernel#singleton_methods when passed false does not return names of inherited singleton methods for a subclass"
179
+ fails "Kernel#singleton_methods when passed false does not return private singleton methods for an object extended with a module including a module" # NoMethodError: undefined method `singleton_methods' for #<MockObject:0x104fe>
180
+ fails "Kernel#singleton_methods when passed false does not return the names of inherited singleton methods for a class extended with a module"
181
+ fails "Kernel#singleton_methods when passed false for a module does not return methods in a module prepended to Module itself" # NoMethodError: undefined method `singleton_methods' for SingletonMethodsSpecs::SelfExtending
182
+ fails "Kernel#singleton_methods when passed false returns an empty Array for an object extended with a module including a module"
183
+ 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>
184
+ 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>
185
+ fails "Kernel#singleton_methods when passed false returns an empty Array for an object extented with a module"
186
+ fails "Kernel#singleton_methods when passed false returns an empty Array for an object extented with two modules"
187
+ fails "Kernel#singleton_methods when passed false returns an empty Array for an object with no singleton methods"
188
+ fails "Kernel#singleton_methods when passed false returns the names of class methods for a class"
189
+ fails "Kernel#singleton_methods when passed false returns the names of module methods for a module"
190
+ fails "Kernel#singleton_methods when passed false returns the names of singleton methods for an object"
191
+ fails "Kernel#singleton_methods when passed false returns the names of singleton methods of the subclass"
192
+ fails "Kernel#singleton_methods when passed true does not return any included methods for a class including a module"
193
+ fails "Kernel#singleton_methods when passed true does not return any included methods for a module including a module"
194
+ fails "Kernel#singleton_methods when passed true does not return private singleton methods for an object extended with a module including a module" # NoMethodError: undefined method `singleton_methods' for #<MockObject:0x104e6>
195
+ fails "Kernel#singleton_methods when passed true for a module does not return methods in a module prepended to Module itself" # NoMethodError: undefined method `singleton_methods' for SingletonMethodsSpecs::SelfExtending
196
+ fails "Kernel#singleton_methods when passed true returns a unique list for a subclass including a module"
197
+ fails "Kernel#singleton_methods when passed true returns a unique list for a subclass"
198
+ fails "Kernel#singleton_methods when passed true returns a unique list for an object extended with a module"
199
+ fails "Kernel#singleton_methods when passed true returns an empty Array for an object with no singleton methods"
200
+ fails "Kernel#singleton_methods when passed true returns the names of class methods for a class"
201
+ fails "Kernel#singleton_methods when passed true returns the names of inherited singleton methods for a class extended with a module"
202
+ fails "Kernel#singleton_methods when passed true returns the names of inherited singleton methods for a subclass including a module"
203
+ fails "Kernel#singleton_methods when passed true returns the names of inherited singleton methods for a subclass of a class including a module"
204
+ fails "Kernel#singleton_methods when passed true returns the names of inherited singleton methods for a subclass of a class that includes a module, where the subclass also includes a module"
205
+ fails "Kernel#singleton_methods when passed true returns the names of inherited singleton methods for a subclass"
206
+ fails "Kernel#singleton_methods when passed true returns the names of module methods for a module"
207
+ 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>
208
+ 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>
209
+ 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>
210
+ fails "Kernel#singleton_methods when passed true returns the names of singleton methods for an object extented with a module including a module"
211
+ fails "Kernel#singleton_methods when passed true returns the names of singleton methods for an object extented with a module"
212
+ fails "Kernel#singleton_methods when passed true returns the names of singleton methods for an object extented with two modules"
213
+ fails "Kernel#singleton_methods when passed true returns the names of singleton methods for an object"
214
+ fails "Kernel#sprintf can produce a string with invalid encoding" # Expected true to be false
215
+ fails "Kernel#sprintf flags # applies to format o does nothing for negative argument" # Expected "0..7651" to equal "..7651"
216
+ fails "Kernel#sprintf flags # applies to formats aAeEfgG changes format from dd.dddd to exponential form for gG" # Expected "1.234e+02" to equal "1.e+02"
217
+ fails "Kernel#sprintf flags # applies to formats aAeEfgG forces a decimal point to be added, even if no digits follow" # NotImplementedError: `A` and `a` format field types are not implemented in Opal yet
218
+ fails "Kernel#sprintf flags (digit)$ specifies the absolute argument number for this field" # NotImplementedError: `A` and `a` format field types are not implemented in Opal yet
219
+ fails "Kernel#sprintf flags * left-justifies the result if specified with $ argument is negative" # Expected "1.095200e+2 " to equal "1.095200e+02 "
220
+ fails "Kernel#sprintf flags * left-justifies the result if width is negative" # Expected "1.095200e+2 " to equal "1.095200e+02 "
221
+ fails "Kernel#sprintf flags * raises ArgumentError when is mixed with width" # Expected ArgumentError but no exception was raised (" 112" was returned)
222
+ fails "Kernel#sprintf flags * uses the previous argument as the field width" # Expected " 1.095200e+02" to equal " 1.095200e+02"
223
+ fails "Kernel#sprintf flags * uses the specified argument as the width if * is followed by a number and $" # Expected " 1.095200e+02" to equal " 1.095200e+02"
224
+ fails "Kernel#sprintf flags + applies to numeric formats bBdiouxXaAeEfgG adds a leading plus sign to non-negative numbers" # NotImplementedError: `A` and `a` format field types are not implemented in Opal yet
225
+ fails "Kernel#sprintf flags - left-justifies the result of conversion if width is specified" # Expected "1.095200e+2 " to equal "1.095200e+02 "
226
+ fails "Kernel#sprintf flags 0 (zero) applies to numeric formats bBdiouxXaAeEfgG and width is specified pads with zeros, not spaces" # Expected "0000000001.095200e+02" to equal "000000001.095200e+02"
227
+ fails "Kernel#sprintf flags space applies to numeric formats bBdiouxXeEfgGaA does not leave a space at the start of negative numbers" # NotImplementedError: `A` and `a` format field types are not implemented in Opal yet
228
+ fails "Kernel#sprintf flags space applies to numeric formats bBdiouxXeEfgGaA leaves a space at the start of non-negative numbers" # NotImplementedError: `A` and `a` format field types are not implemented in Opal yet
229
+ fails "Kernel#sprintf flags space applies to numeric formats bBdiouxXeEfgGaA treats several white spaces as one" # NotImplementedError: `A` and `a` format field types are not implemented in Opal yet
230
+ fails "Kernel#sprintf float formats A converts floating point argument as [-]0xh.hhhhp[+-]dd and use uppercase X and P" # NotImplementedError: `A` and `a` format field types are not implemented in Opal yet
231
+ fails "Kernel#sprintf float formats A displays Float::INFINITY as Inf" # NotImplementedError: `A` and `a` format field types are not implemented in Opal yet
232
+ fails "Kernel#sprintf float formats A displays Float::NAN as NaN" # NotImplementedError: `A` and `a` format field types are not implemented in Opal yet
233
+ fails "Kernel#sprintf float formats G otherwise cuts excessive digits in fractional part and keeps only 4 ones" # Expected "12.12341111" to equal "12.1234"
234
+ fails "Kernel#sprintf float formats G otherwise cuts fraction part to have only 6 digits at all" # Expected "1.1234567" to equal "1.12346"
235
+ fails "Kernel#sprintf float formats G otherwise rounds the last significant digit to the closest one in fractional part" # Expected "1.555555555" to equal "1.55556"
236
+ fails "Kernel#sprintf float formats G the exponent is greater than or equal to the precision (6 by default) converts a floating point number using exponential form" # Expected "1.234567E+06" to equal "1.23457E+06"
237
+ fails "Kernel#sprintf float formats a converts floating point argument as [-]0xh.hhhhp[+-]dd" # NotImplementedError: `A` and `a` format field types are not implemented in Opal yet
238
+ fails "Kernel#sprintf float formats a displays Float::INFINITY as Inf" # NotImplementedError: `A` and `a` format field types are not implemented in Opal yet
239
+ fails "Kernel#sprintf float formats a displays Float::NAN as NaN" # NotImplementedError: `A` and `a` format field types are not implemented in Opal yet
240
+ fails "Kernel#sprintf float formats g otherwise cuts excessive digits in fractional part and keeps only 4 ones" # Expected "12.12341111" to equal "12.1234"
241
+ fails "Kernel#sprintf float formats g otherwise cuts fraction part to have only 6 digits at all" # Expected "1.1234567" to equal "1.12346"
242
+ fails "Kernel#sprintf float formats g otherwise rounds the last significant digit to the closest one in fractional part" # Expected "1.555555555" to equal "1.55556"
243
+ fails "Kernel#sprintf float formats g the exponent is greater than or equal to the precision (6 by default) converts a floating point number using exponential form" # Expected "1.234567e+06" to equal "1.23457e+06"
244
+ fails "Kernel#sprintf integer formats d works well with large numbers" # Expected "1234567890987654400" to equal "1234567890987654321"
245
+ fails "Kernel#sprintf integer formats i works well with large numbers" # Expected "1234567890987654400" to equal "1234567890987654321"
246
+ fails "Kernel#sprintf integer formats u works well with large numbers" # Expected "1234567890987654400" to equal "1234567890987654321"
247
+ fails "Kernel#sprintf other formats % alone raises an ArgumentError" # Expected ArgumentError but no exception was raised ("%" was returned)
248
+ fails "Kernel#sprintf precision float types controls the number of decimal places displayed in fraction part" # NotImplementedError: `A` and `a` format field types are not implemented in Opal yet
249
+ fails "Kernel#sprintf precision float types does not affect G format" # Expected "12.12340000" to equal "12.1234"
250
+ fails "Kernel#sprintf precision string formats determines the maximum number of characters to be copied from the string" # Expected "1" to equal "["
251
+ fails "Kernel#sprintf raises Encoding::CompatibilityError if both encodings are ASCII compatible and there ano not ASCII characters" # ArgumentError: unknown encoding name - windows-1252
252
+ 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"
253
+ fails "Kernel#sprintf with format string that contains %<> sections raises ArgumentError if missing second named argument" # KeyError: key not found: "foo"
254
+ fails "Kernel#then returns a sized Enumerator when no block given" # NoMethodError: undefined method `then' for #<Object:0x22882>
255
+ 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"
256
+ fails "Kernel#warn :uplevel keyword argument converts value to Integer" # TypeError: no implicit conversion of Number into Integer
257
+ fails "Kernel#warn :uplevel keyword argument does not prepend caller information if the uplevel argument is too large" # Expected: $stderr: "warning: foo\n" got: $stderr: "ruby/core/kernel/fixtures/classes.rb:441:7:in `warn': warning: foo\n"
258
+ 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"
259
+ fails "Kernel#warn :uplevel keyword argument prepends even if a message is empty or nil" # Expected: $stderr: /core\/kernel\/fixtures\/classes.rb:441: warning: \n$/ got: $stderr: "ruby/core/kernel/fixtures/classes.rb:441:7:in `warn': warning: \n"
260
+ fails "Kernel#warn :uplevel keyword argument raises if :category keyword is not nil and not convertible to symbol" # Expected TypeError but no exception was raised (nil was returned)
261
+ fails "Kernel#warn :uplevel keyword argument shows the caller of #require and not #require itself with RubyGems loaded" # NoMethodError: undefined method `tmp' for #<MSpecEnv:0x28d18>
262
+ fails "Kernel#warn :uplevel keyword argument shows the caller of #require and not #require itself without RubyGems" # NoMethodError: undefined method `insert' for "rubyexe.rb"
263
+ fails "Kernel#warn :uplevel keyword argument skips <internal: core library methods defined in Ruby" # NoMethodError: undefined method `insert' for "rubyexe.rb"
264
+ fails "Kernel#warn avoids recursion if Warning#warn is redefined and calls super" # NoMethodError: undefined method `insert' for "rubyexe.rb"
265
+ fails "Kernel#warn does not call Warning.warn if self is the Warning module" # NoMethodError: undefined method `insert' for "rubyexe.rb"
266
+ 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
267
+ fails "Kernel#yield_self returns a sized Enumerator when no block given" # Requires Enumerator#peek
268
+ fails "Kernel.Complex() when passed Numerics n1 and n2 and at least one responds to #real? with false returns n1 + n2 * Complex(0, 1)"
269
+ fails "Kernel.Complex() when passed [Complex, Complex] returns a new Complex number based on the two given numbers"
270
+ fails "Kernel.Complex() when passed [Complex] returns the passed Complex number"
271
+ fails "Kernel.Complex() when passed a Numeric which responds to #real? with false returns the passed argument"
272
+ fails "Kernel.Complex() when passed a non-Numeric second argument raises TypeError"
273
+ fails "Kernel.Complex() when passed a single non-Numeric coerces the passed argument using #to_c"
274
+ fails "Kernel.Complex() when passed an Object which responds to #to_c returns the passed argument" # Expected (#<Object:0x332c0>+0i) to equal (0+1i)
275
+ fails "Kernel.Complex() when passed an Objectc which responds to #to_c returns the passed argument" # Expected (#<Object:0x46fa6>+0i) to equal (0+1i)
276
+ 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
277
+ 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)
278
+ 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))
279
+ fails "Kernel.Complex() when passed exception: false and [non-Numeric] swallows an error" # Expected #<Complex>(#pretty_inspect raised #<NoMethodError: undefined method `positive?' for {"exception"=>false}>) == nil to be truthy but was false
280
+ fails "Kernel.Complex() when passed exception: false and nil arguments swallows an error" # Expected #<Complex>(#pretty_inspect raised #<NoMethodError: undefined method `positive?' for {"exception"=>false}>) == nil to be truthy but was false
281
+ fails "Kernel.Complex() when passed exception: false and non-numeric String arguments swallows an error" # ArgumentError: [MSpecEnv#Complex] wrong number of arguments(3 for -2)
282
+ fails "Kernel.Complex() when passed nil raises TypeError" # Expected TypeError (can't convert nil into Complex) but no exception was raised ((nil+0i) was returned)
283
+ fails "Kernel.Float for hexadecimal literals with binary exponent allows embedded _ in a number on either side of the P"
284
+ fails "Kernel.Float for hexadecimal literals with binary exponent allows embedded _ in a number on either side of the p"
285
+ fails "Kernel.Float for hexadecimal literals with binary exponent allows hexadecimal points on the left side of the 'P'"
286
+ fails "Kernel.Float for hexadecimal literals with binary exponent allows hexadecimal points on the left side of the 'p'"
287
+ fails "Kernel.Float for hexadecimal literals with binary exponent interprets the exponent (on the right of 'P') in decimal"
288
+ fails "Kernel.Float for hexadecimal literals with binary exponent interprets the exponent (on the right of 'p') in decimal"
289
+ fails "Kernel.Float for hexadecimal literals with binary exponent interprets the fractional part (on the left side of 'P') in hexadecimal"
290
+ fails "Kernel.Float for hexadecimal literals with binary exponent interprets the fractional part (on the left side of 'p') in hexadecimal"
291
+ fails "Kernel.Float for hexadecimal literals with binary exponent returns 0 for '0x1P-10000'"
292
+ fails "Kernel.Float for hexadecimal literals with binary exponent returns 0 for '0x1p-10000'"
293
+ fails "Kernel.Float for hexadecimal literals with binary exponent returns Infinity for '0x1P10000'"
294
+ fails "Kernel.Float for hexadecimal literals with binary exponent returns Infinity for '0x1p10000'"
295
+ fails "Kernel.Float when passed exception: false and invalid input swallows an error" # ArgumentError: [Kernel.Float] wrong number of arguments(2 for 1)
296
+ fails "Kernel.Float when passed exception: false and nil swallows it" # ArgumentError: [Kernel.Float] wrong number of arguments(2 for 1)
297
+ fails "Kernel.Float when passed exception: false and valid input returns a Float number" # ArgumentError: [Kernel.Float] wrong number of arguments(2 for 1)
298
+ fails "Kernel.Integer raises a TypeError when to_int returns not-an-Integer object and to_i returns nil" # Expected TypeError but no exception was raised ("1" was returned)
299
+ fails "Kernel.Integer return a result of to_i when to_int does not return an Integer" # Expected "1" == 42 to be truthy but was false
300
+ fails "Kernel.Integer when passed exception: false and an argument that contains a period swallows an error" # TypeError: no implicit conversion of Hash into Integer
301
+ fails "Kernel.Integer when passed exception: false and an empty string swallows an error" # TypeError: no implicit conversion of Hash into Integer
302
+ fails "Kernel.Integer when passed exception: false and invalid argument swallows an error" # ArgumentError: [MSpecEnv#Integer] wrong number of arguments(3 for -2)
303
+ fails "Kernel.Integer when passed exception: false and multiple leading -s swallows an error" # TypeError: no implicit conversion of Hash into Integer
304
+ fails "Kernel.Integer when passed exception: false and multiple trailing -s swallows an error" # TypeError: no implicit conversion of Hash into Integer
305
+ fails "Kernel.Integer when passed exception: false and no to_int or to_i methods exist swallows an error" # ArgumentError: base specified for non string value
306
+ fails "Kernel.Integer when passed exception: false and passed Infinity swallows an error" # ArgumentError: base specified for non string value
307
+ fails "Kernel.Integer when passed exception: false and passed NaN swallows an error" # ArgumentError: base specified for non string value
308
+ fails "Kernel.Integer when passed exception: false and passed a String that can't be converted to an Integer swallows an error" # TypeError: no implicit conversion of Hash into Integer
309
+ fails "Kernel.Integer when passed exception: false and passed a String that contains numbers normally parses it and returns an Integer" # TypeError: no implicit conversion of Hash into Integer
310
+ fails "Kernel.Integer when passed exception: false and passed nil swallows an error" # ArgumentError: base specified for non string value
311
+ fails "Kernel.Integer when passed exception: false and to_i returns a value that is not an Integer swallows an error" # ArgumentError: base specified for non string value
312
+ fails "Kernel.Integer when passed exception: false and to_int returns nil and no to_i exists swallows an error" # ArgumentError: base specified for non string value
313
+ fails "Kernel.Integer when passed exception: false and valid argument returns an Integer number" # ArgumentError: [MSpecEnv#Integer] wrong number of arguments(3 for -2)
314
+ fails "Kernel.Rational when passed a String converts the String to a Rational using the same method as String#to_r"
315
+ fails "Kernel.Rational when passed a String does not use the same method as Float#to_r"
316
+ fails "Kernel.Rational when passed a String raises a TypeError if the first argument is a Symbol"
317
+ fails "Kernel.Rational when passed a String raises a TypeError if the second argument is a Symbol"
318
+ fails "Kernel.Rational when passed a String scales the Rational value of the first argument by the Rational value of the second"
319
+ fails "Kernel.Rational when passed a String when passed a Numeric calls #to_r to convert the first argument to a Rational"
320
+ fails "Kernel.Rational when passed exception: false and [anything, non-Numeric] swallows an error" # ArgumentError: [MSpecEnv#Rational] wrong number of arguments(3 for -2)
321
+ fails "Kernel.Rational when passed exception: false and [non-Numeric, Numeric] swallows an error" # ArgumentError: [MSpecEnv#Rational] wrong number of arguments(3 for -2)
322
+ fails "Kernel.Rational when passed exception: false and [non-Numeric] swallows an error" # NoMethodError: undefined method `to_i' for {"exception"=>false}
323
+ fails "Kernel.Rational when passed exception: false and nil arguments swallows an error" # TypeError: cannot convert nil into Rational
324
+ fails "Kernel.Rational when passed exception: false and non-Numeric String arguments swallows an error" # ArgumentError: [MSpecEnv#Rational] wrong number of arguments(3 for -2)
325
+ fails "Kernel.String calls #to_s if #respond_to?(:to_s) returns true" # TypeError: no implicit conversion of MockObject into String
326
+ fails "Kernel.String raises a TypeError if #to_s is not defined, even though #respond_to?(:to_s) returns true"
327
+ fails "Kernel.__callee__ returns method name even from eval"
328
+ fails "Kernel.__callee__ returns method name even from send"
329
+ fails "Kernel.__callee__ returns the aliased name when aliased method"
330
+ fails "Kernel.__callee__ returns the caller from a define_method called from the same class"
331
+ fails "Kernel.__callee__ returns the caller from block inside define_method too"
332
+ fails "Kernel.__callee__ returns the caller from blocks too"
333
+ fails "Kernel.__callee__ returns the caller from define_method too"
334
+ fails "Kernel.__method__ returns method name even from eval"
335
+ fails "Kernel.__method__ returns method name even from send"
336
+ fails "Kernel.__method__ returns the caller from block inside define_method too"
337
+ fails "Kernel.__method__ returns the caller from blocks too"
338
+ fails "Kernel.__method__ returns the caller from define_method too"
339
+ fails "Kernel.autoload calls #to_path on non-String filenames" # Mock 'path' expected to receive to_path("any_args") exactly 1 times but received it 0 times
340
+ fails "Kernel.autoload registers a file to load the first time the toplevel constant is accessed" # NoMethodError: undefined method `autoload?' for Kernel
341
+ fails "Kernel.autoload sets the autoload constant in Object's constant table" # Expected Object to have constant 'KSAutoloadBB' but it does not
342
+ fails "Kernel.autoload when called from included module's method setups the autoload on the included module" # NoMethodError: undefined method `autoload?' for KernelSpecs::AutoloadMethod2
343
+ fails "Kernel.autoload when called from included module's method the autoload is reachable from the class too" # NoMethodError: undefined method `autoload?' for KernelSpecs::AutoloadMethodIncluder2
344
+ fails "Kernel.autoload when called from included module's method the autoload relative to the included module works" # NameError: uninitialized constant KernelSpecs::AutoloadMethod2::AutoloadFromIncludedModule2
345
+ fails "Kernel.autoload? returns nil if no file has been registered for a constant" # NoMethodError: undefined method `autoload?' for Kernel
346
+ fails "Kernel.autoload? returns the name of the file that will be autoloaded" # NoMethodError: undefined method `autoload?' for Kernel
347
+ fails "Kernel.global_variables finds subset starting with std"
348
+ fails "Kernel.lambda does not create lambda-style Procs when captured with #method" # Expected true to be false
349
+ fails "Kernel.lambda raises an ArgumentError when no block is given"
350
+ fails "Kernel.lambda returned the passed Proc if given an existing Proc" # Expected true to be false
351
+ fails "Kernel.lambda returns from the lambda itself, not the creation site of the lambda"
352
+ fails "Kernel.lambda returns the passed Proc if given an existing Proc through super" # Expected true to be false
353
+ fails "Kernel.lambda returns the passed Proc if given an existing Proc" # Expected true to be false
354
+ fails "Kernel.loop returns StopIteration#result, the result value of a finished iterator" # requires changes in enumerator.rb
355
+ fails "Kernel.printf calls write on the first argument when it is not a string"
356
+ fails "Kernel.printf writes to stdout when a string is the first argument"
357
+ fails "Kernel.proc returned the passed Proc if given an existing Proc" # Expected false to be true
358
+ fails "Kernel.rand is random on boot" # NoMethodError: undefined method `insert' for "rubyexe.rb"
359
+ fails "Kernel.rand supports custom object types" # Expected "NaN#<struct KernelSpecs::CustomRangeInteger value=1>" (String) to be an instance of KernelSpecs::CustomRangeInteger
360
+ fails "Kernel.sprintf can produce a string with invalid encoding" # Expected true to be false
361
+ fails "Kernel.sprintf flags # applies to format o does nothing for negative argument" # Expected "0..7651" to equal "..7651"
362
+ fails "Kernel.sprintf flags # applies to formats aAeEfgG changes format from dd.dddd to exponential form for gG" # Expected "1.234e+02" to equal "1.e+02"
363
+ fails "Kernel.sprintf flags # applies to formats aAeEfgG forces a decimal point to be added, even if no digits follow" # NotImplementedError: `A` and `a` format field types are not implemented in Opal yet
364
+ fails "Kernel.sprintf flags (digit)$ specifies the absolute argument number for this field" # NotImplementedError: `A` and `a` format field types are not implemented in Opal yet
365
+ fails "Kernel.sprintf flags * left-justifies the result if specified with $ argument is negative" # Expected "1.095200e+2 " to equal "1.095200e+02 "
366
+ fails "Kernel.sprintf flags * left-justifies the result if width is negative" # Expected "1.095200e+2 " to equal "1.095200e+02 "
367
+ fails "Kernel.sprintf flags * raises ArgumentError when is mixed with width" # Expected ArgumentError but no exception was raised (" 112" was returned)
368
+ fails "Kernel.sprintf flags * uses the previous argument as the field width" # Expected " 1.095200e+02" to equal " 1.095200e+02"
369
+ fails "Kernel.sprintf flags * uses the specified argument as the width if * is followed by a number and $" # Expected " 1.095200e+02" to equal " 1.095200e+02"
370
+ fails "Kernel.sprintf flags + applies to numeric formats bBdiouxXaAeEfgG adds a leading plus sign to non-negative numbers" # NotImplementedError: `A` and `a` format field types are not implemented in Opal yet
371
+ fails "Kernel.sprintf flags - left-justifies the result of conversion if width is specified" # Expected "1.095200e+2 " to equal "1.095200e+02 "
372
+ fails "Kernel.sprintf flags 0 (zero) applies to numeric formats bBdiouxXaAeEfgG and width is specified pads with zeros, not spaces" # Expected "0000000001.095200e+02" to equal "000000001.095200e+02"
373
+ fails "Kernel.sprintf flags space applies to numeric formats bBdiouxXeEfgGaA does not leave a space at the start of negative numbers" # NotImplementedError: `A` and `a` format field types are not implemented in Opal yet
374
+ fails "Kernel.sprintf flags space applies to numeric formats bBdiouxXeEfgGaA leaves a space at the start of non-negative numbers" # NotImplementedError: `A` and `a` format field types are not implemented in Opal yet
375
+ fails "Kernel.sprintf flags space applies to numeric formats bBdiouxXeEfgGaA treats several white spaces as one" # NotImplementedError: `A` and `a` format field types are not implemented in Opal yet
376
+ fails "Kernel.sprintf float formats A converts floating point argument as [-]0xh.hhhhp[+-]dd and use uppercase X and P" # NotImplementedError: `A` and `a` format field types are not implemented in Opal yet
377
+ fails "Kernel.sprintf float formats A displays Float::INFINITY as Inf" # NotImplementedError: `A` and `a` format field types are not implemented in Opal yet
378
+ fails "Kernel.sprintf float formats A displays Float::NAN as NaN" # NotImplementedError: `A` and `a` format field types are not implemented in Opal yet
379
+ fails "Kernel.sprintf float formats G otherwise cuts excessive digits in fractional part and keeps only 4 ones" # Expected "12.12341111" to equal "12.1234"
380
+ fails "Kernel.sprintf float formats G otherwise cuts fraction part to have only 6 digits at all" # Expected "1.1234567" to equal "1.12346"
381
+ fails "Kernel.sprintf float formats G otherwise rounds the last significant digit to the closest one in fractional part" # Expected "1.555555555" to equal "1.55556"
382
+ fails "Kernel.sprintf float formats G the exponent is greater than or equal to the precision (6 by default) converts a floating point number using exponential form" # Expected "1.234567E+06" to equal "1.23457E+06"
383
+ fails "Kernel.sprintf float formats a converts floating point argument as [-]0xh.hhhhp[+-]dd" # NotImplementedError: `A` and `a` format field types are not implemented in Opal yet
384
+ fails "Kernel.sprintf float formats a displays Float::INFINITY as Inf" # NotImplementedError: `A` and `a` format field types are not implemented in Opal yet
385
+ fails "Kernel.sprintf float formats a displays Float::NAN as NaN" # NotImplementedError: `A` and `a` format field types are not implemented in Opal yet
386
+ fails "Kernel.sprintf float formats g otherwise cuts excessive digits in fractional part and keeps only 4 ones" # Expected "12.12341111" to equal "12.1234"
387
+ fails "Kernel.sprintf float formats g otherwise cuts fraction part to have only 6 digits at all" # Expected "1.1234567" to equal "1.12346"
388
+ fails "Kernel.sprintf float formats g otherwise rounds the last significant digit to the closest one in fractional part" # Expected "1.555555555" to equal "1.55556"
389
+ fails "Kernel.sprintf float formats g the exponent is greater than or equal to the precision (6 by default) converts a floating point number using exponential form" # Expected "1.234567e+06" to equal "1.23457e+06"
390
+ fails "Kernel.sprintf integer formats d works well with large numbers" # Expected "1234567890987654400" to equal "1234567890987654321"
391
+ fails "Kernel.sprintf integer formats i works well with large numbers" # Expected "1234567890987654400" to equal "1234567890987654321"
392
+ fails "Kernel.sprintf integer formats u works well with large numbers" # Expected "1234567890987654400" to equal "1234567890987654321"
393
+ fails "Kernel.sprintf other formats % alone raises an ArgumentError" # Expected ArgumentError but no exception was raised ("%" was returned)
394
+ fails "Kernel.sprintf precision float types controls the number of decimal places displayed in fraction part" # NotImplementedError: `A` and `a` format field types are not implemented in Opal yet
395
+ fails "Kernel.sprintf precision float types does not affect G format" # Expected "12.12340000" to equal "12.1234"
396
+ fails "Kernel.sprintf precision string formats determines the maximum number of characters to be copied from the string" # Expected "1" to equal "["
397
+ fails "Kernel.sprintf raises Encoding::CompatibilityError if both encodings are ASCII compatible and there ano not ASCII characters" # ArgumentError: unknown encoding name - windows-1252
398
+ fails "Kernel.sprintf returns a String in the same encoding as the format String if compatible" # NameError: uninitialized constant Encoding::KOI8_U
399
+ 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"
400
+ fails "Kernel.srand returns the previous seed value on the first call" # NoMethodError: undefined method `insert' for "rubyexe.rb"
401
+ end