opal-cj 0.7.0.beta1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +10 -0
- data/.gitmodules +27 -0
- data/.rspec +3 -0
- data/.spectator +2 -0
- data/.spectator-mspec +3 -0
- data/.travis.yml +45 -0
- data/CHANGELOG.md +406 -0
- data/CONTRIBUTING.md +41 -0
- data/Gemfile +27 -0
- data/Guardfile +77 -0
- data/LICENSE +19 -0
- data/README.md +178 -0
- data/Rakefile +116 -0
- data/benchmarks/operators.rb +11 -0
- data/bin/opal +22 -0
- data/bin/opal-build +77 -0
- data/bin/opal-mspec +10 -0
- data/bin/opal-repl +72 -0
- data/config.ru +14 -0
- data/examples/rack/Gemfile +3 -0
- data/examples/rack/app/application.rb +13 -0
- data/examples/rack/app/user.rb +21 -0
- data/examples/rack/config.ru +7 -0
- data/examples/rack/index.html.erb +10 -0
- data/examples/sinatra/Gemfile +4 -0
- data/examples/sinatra/app/application.rb +7 -0
- data/examples/sinatra/config.ru +28 -0
- data/lib/mspec/opal/main.rb.erb +9 -0
- data/lib/mspec/opal/rake_task.rb +278 -0
- data/lib/mspec/opal/runner.rb +206 -0
- data/lib/mspec/opal/sprockets.js +57 -0
- data/lib/opal.rb +11 -0
- data/lib/opal/builder.rb +135 -0
- data/lib/opal/builder_processors.rb +165 -0
- data/lib/opal/cli.rb +145 -0
- data/lib/opal/cli_options.rb +149 -0
- data/lib/opal/cli_runners.rb +10 -0
- data/lib/opal/cli_runners/nodejs.rb +56 -0
- data/lib/opal/cli_runners/phantom.js +35 -0
- data/lib/opal/cli_runners/phantomjs.rb +28 -0
- data/lib/opal/cli_runners/server.rb +54 -0
- data/lib/opal/compiler.rb +307 -0
- data/lib/opal/erb.rb +64 -0
- data/lib/opal/fragment.rb +41 -0
- data/lib/opal/hike_path_finder.rb +18 -0
- data/lib/opal/nodes.rb +26 -0
- data/lib/opal/nodes/arglist.rb +56 -0
- data/lib/opal/nodes/array.rb +54 -0
- data/lib/opal/nodes/base.rb +151 -0
- data/lib/opal/nodes/call.rb +283 -0
- data/lib/opal/nodes/call_special.rb +178 -0
- data/lib/opal/nodes/case.rb +96 -0
- data/lib/opal/nodes/class.rb +42 -0
- data/lib/opal/nodes/constants.rb +78 -0
- data/lib/opal/nodes/def.rb +157 -0
- data/lib/opal/nodes/defined.rb +113 -0
- data/lib/opal/nodes/definitions.rb +168 -0
- data/lib/opal/nodes/for.rb +35 -0
- data/lib/opal/nodes/hash.rb +67 -0
- data/lib/opal/nodes/helpers.rb +114 -0
- data/lib/opal/nodes/if.rb +67 -0
- data/lib/opal/nodes/iter.rb +131 -0
- data/lib/opal/nodes/literal.rb +230 -0
- data/lib/opal/nodes/logic.rb +217 -0
- data/lib/opal/nodes/masgn.rb +62 -0
- data/lib/opal/nodes/module.rb +46 -0
- data/lib/opal/nodes/rescue.rb +135 -0
- data/lib/opal/nodes/runtime_helpers.rb +45 -0
- data/lib/opal/nodes/scope.rb +293 -0
- data/lib/opal/nodes/singleton_class.rb +25 -0
- data/lib/opal/nodes/super.rb +97 -0
- data/lib/opal/nodes/top.rb +101 -0
- data/lib/opal/nodes/variables.rb +158 -0
- data/lib/opal/nodes/while.rb +65 -0
- data/lib/opal/nodes/yield.rb +95 -0
- data/lib/opal/parser.rb +658 -0
- data/lib/opal/parser/grammar.rb +5452 -0
- data/lib/opal/parser/grammar.y +1684 -0
- data/lib/opal/parser/keywords.rb +66 -0
- data/lib/opal/parser/lexer.rb +1208 -0
- data/lib/opal/parser/parser_scope.rb +25 -0
- data/lib/opal/parser/sexp.rb +75 -0
- data/lib/opal/path_reader.rb +28 -0
- data/lib/opal/paths.rb +38 -0
- data/lib/opal/source_map.rb +70 -0
- data/lib/opal/sprockets.rb +4 -0
- data/lib/opal/sprockets/cache_key_fix.rb +17 -0
- data/lib/opal/sprockets/environment.rb +37 -0
- data/lib/opal/sprockets/erb.rb +37 -0
- data/lib/opal/sprockets/path_reader.rb +34 -0
- data/lib/opal/sprockets/processor.rb +124 -0
- data/lib/opal/sprockets/server.rb +180 -0
- data/lib/opal/util.rb +64 -0
- data/lib/opal/version.rb +3 -0
- data/opal.gemspec +36 -0
- data/opal/README.md +6 -0
- data/opal/corelib/array.rb +1556 -0
- data/opal/corelib/array/inheritance.rb +113 -0
- data/opal/corelib/basic_object.rb +73 -0
- data/opal/corelib/boolean.rb +41 -0
- data/opal/corelib/class.rb +55 -0
- data/opal/corelib/comparable.rb +56 -0
- data/opal/corelib/complex.rb +3 -0
- data/opal/corelib/dir.rb +20 -0
- data/opal/corelib/enumerable.rb +1132 -0
- data/opal/corelib/enumerator.rb +422 -0
- data/opal/corelib/error.rb +63 -0
- data/opal/corelib/file.rb +56 -0
- data/opal/corelib/hash.rb +728 -0
- data/opal/corelib/helpers.rb +102 -0
- data/opal/corelib/io.rb +59 -0
- data/opal/corelib/kernel.rb +569 -0
- data/opal/corelib/main.rb +7 -0
- data/opal/corelib/match_data.rb +114 -0
- data/opal/corelib/method.rb +58 -0
- data/opal/corelib/module.rb +462 -0
- data/opal/corelib/nil_class.rb +62 -0
- data/opal/corelib/numeric.rb +532 -0
- data/opal/corelib/proc.rb +52 -0
- data/opal/corelib/range.rb +116 -0
- data/opal/corelib/rational.rb +3 -0
- data/opal/corelib/regexp.rb +133 -0
- data/opal/corelib/runtime.js +1240 -0
- data/opal/corelib/string.rb +1212 -0
- data/opal/corelib/string/inheritance.rb +78 -0
- data/opal/corelib/struct.rb +141 -0
- data/opal/corelib/time.rb +584 -0
- data/opal/corelib/variables.rb +24 -0
- data/opal/opal.rb +32 -0
- data/package.json +9 -0
- data/spec/filters/bugs/array.rb +232 -0
- data/spec/filters/bugs/basic_object.rb +14 -0
- data/spec/filters/bugs/class.rb +21 -0
- data/spec/filters/bugs/enumerable.rb +69 -0
- data/spec/filters/bugs/enumerator.rb +3 -0
- data/spec/filters/bugs/hash.rb +128 -0
- data/spec/filters/bugs/kernel.rb +10 -0
- data/spec/filters/bugs/language.rb +415 -0
- data/spec/filters/bugs/math.rb +95 -0
- data/spec/filters/bugs/module.rb +14 -0
- data/spec/filters/bugs/nil.rb +7 -0
- data/spec/filters/bugs/numeric.rb +20 -0
- data/spec/filters/bugs/opal.rb +14 -0
- data/spec/filters/bugs/regexp.rb +11 -0
- data/spec/filters/bugs/set.rb +7 -0
- data/spec/filters/bugs/singleton.rb +6 -0
- data/spec/filters/bugs/string.rb +360 -0
- data/spec/filters/bugs/stringscanner.rb +22 -0
- data/spec/filters/bugs/struct.rb +45 -0
- data/spec/filters/bugs/time.rb +177 -0
- data/spec/filters/bugs/unknown.rb +11 -0
- data/spec/filters/unsupported/encoding.rb +95 -0
- data/spec/filters/unsupported/enumerator.rb +14 -0
- data/spec/filters/unsupported/float.rb +5 -0
- data/spec/filters/unsupported/frozen.rb +90 -0
- data/spec/filters/unsupported/hash_compare_by_identity.rb +16 -0
- data/spec/filters/unsupported/integer_size.rb +7 -0
- data/spec/filters/unsupported/method_added.rb +10 -0
- data/spec/filters/unsupported/mutable_strings.rb +361 -0
- data/spec/filters/unsupported/private_constants.rb +30 -0
- data/spec/filters/unsupported/private_methods.rb +44 -0
- data/spec/filters/unsupported/random.rb +4 -0
- data/spec/filters/unsupported/ruby_exe.rb +5 -0
- data/spec/filters/unsupported/tainted.rb +155 -0
- data/spec/filters/unsupported/time.rb +21 -0
- data/spec/filters/unsupported/trusted.rb +80 -0
- data/spec/lib/builder_processors_spec.rb +27 -0
- data/spec/lib/builder_spec.rb +66 -0
- data/spec/lib/cli_spec.rb +134 -0
- data/spec/lib/compiler_spec.rb +197 -0
- data/spec/lib/dependency_resolver_spec.rb +40 -0
- data/spec/lib/fixtures/no_requires.rb +1 -0
- data/spec/lib/fixtures/opal_file.rb +2 -0
- data/spec/lib/fixtures/require_tree_test.rb +3 -0
- data/spec/lib/fixtures/required_tree_test/required_file1.rb +1 -0
- data/spec/lib/fixtures/required_tree_test/required_file2.rb +1 -0
- data/spec/lib/fixtures/requires.rb +7 -0
- data/spec/lib/fixtures/sprockets_file.js.rb +3 -0
- data/spec/lib/fixtures/sprockets_require_tree_test.rb +3 -0
- data/spec/lib/hike_path_finder_spec.rb +23 -0
- data/spec/lib/lexer_spec.rb +110 -0
- data/spec/lib/parser/alias_spec.rb +26 -0
- data/spec/lib/parser/and_spec.rb +13 -0
- data/spec/lib/parser/attrasgn_spec.rb +28 -0
- data/spec/lib/parser/begin_spec.rb +42 -0
- data/spec/lib/parser/block_spec.rb +12 -0
- data/spec/lib/parser/break_spec.rb +17 -0
- data/spec/lib/parser/call_spec.rb +139 -0
- data/spec/lib/parser/class_spec.rb +35 -0
- data/spec/lib/parser/comments_spec.rb +11 -0
- data/spec/lib/parser/def_spec.rb +61 -0
- data/spec/lib/parser/if_spec.rb +26 -0
- data/spec/lib/parser/iter_spec.rb +59 -0
- data/spec/lib/parser/lambda_spec.rb +64 -0
- data/spec/lib/parser/literal_spec.rb +118 -0
- data/spec/lib/parser/masgn_spec.rb +37 -0
- data/spec/lib/parser/module_spec.rb +27 -0
- data/spec/lib/parser/not_spec.rb +27 -0
- data/spec/lib/parser/op_asgn1_spec.rb +23 -0
- data/spec/lib/parser/op_asgn2_spec.rb +23 -0
- data/spec/lib/parser/or_spec.rb +13 -0
- data/spec/lib/parser/return_spec.rb +17 -0
- data/spec/lib/parser/sclass_spec.rb +21 -0
- data/spec/lib/parser/string_spec.rb +276 -0
- data/spec/lib/parser/super_spec.rb +20 -0
- data/spec/lib/parser/unary_spec.rb +48 -0
- data/spec/lib/parser/undef_spec.rb +15 -0
- data/spec/lib/parser/unless_spec.rb +13 -0
- data/spec/lib/parser/variables_spec.rb +92 -0
- data/spec/lib/parser/while_spec.rb +15 -0
- data/spec/lib/parser/yield_spec.rb +20 -0
- data/spec/lib/path_reader_spec.rb +24 -0
- data/spec/lib/shared/path_finder_shared.rb +19 -0
- data/spec/lib/shared/path_reader_shared.rb +31 -0
- data/spec/lib/spec_helper.rb +9 -0
- data/spec/lib/sprockets/environment_spec.rb +30 -0
- data/spec/lib/sprockets/erb_spec.rb +25 -0
- data/spec/lib/sprockets/path_reader_spec.rb +25 -0
- data/spec/lib/sprockets/processor_spec.rb +35 -0
- data/spec/lib/sprockets/server_spec.rb +20 -0
- data/spec/opal/compiler/irb_spec.rb +44 -0
- data/spec/opal/core/array/select_spec.rb +14 -0
- data/spec/opal/core/array/set_range_to_array_spec.rb +7 -0
- data/spec/opal/core/date_spec.rb +122 -0
- data/spec/opal/core/enumerable/all_break_spec.rb +5 -0
- data/spec/opal/core/enumerable/any_break_spec.rb +5 -0
- data/spec/opal/core/enumerable/collect_break_spec.rb +13 -0
- data/spec/opal/core/enumerable/count_break_spec.rb +5 -0
- data/spec/opal/core/enumerable/detect_break_spec.rb +5 -0
- data/spec/opal/core/enumerable/drop_while_break_spec.rb +5 -0
- data/spec/opal/core/enumerable/each_slice_break.rb +6 -0
- data/spec/opal/core/enumerable/each_with_index_break_spec.rb +5 -0
- data/spec/opal/core/enumerable/each_with_object_break_spec.rb +5 -0
- data/spec/opal/core/enumerable/find_all_break_spec.rb +5 -0
- data/spec/opal/core/enumerable/find_index_break_spec.rb +5 -0
- data/spec/opal/core/enumerable/grep_break_spec.rb +5 -0
- data/spec/opal/core/enumerable/max_break_spec.rb +5 -0
- data/spec/opal/core/enumerable/max_by_break_spec.rb +5 -0
- data/spec/opal/core/enumerable/min_break_spec.rb +5 -0
- data/spec/opal/core/enumerable/min_by_break_spec.rb +5 -0
- data/spec/opal/core/enumerable/none_break_spec.rb +5 -0
- data/spec/opal/core/enumerable/one_break_spec.rb +5 -0
- data/spec/opal/core/enumerable/reduce_break_spec.rb +5 -0
- data/spec/opal/core/enumerable/take_while_break_spec.rb +5 -0
- data/spec/opal/core/fixtures/class.rb +124 -0
- data/spec/opal/core/fixtures/class_variables.rb +0 -0
- data/spec/opal/core/fixtures/constants.rb +33 -0
- data/spec/opal/core/fixtures/require_tree_files/file 1.rb +1 -0
- data/spec/opal/core/fixtures/require_tree_files/file 2.rb +1 -0
- data/spec/opal/core/fixtures/require_tree_files/file 3.rb +1 -0
- data/spec/opal/core/fixtures/require_tree_files/file 4.rb +1 -0
- data/spec/opal/core/fixtures/require_tree_files/file 5.rb +1 -0
- data/spec/opal/core/kernel/Array_spec.rb +10 -0
- data/spec/opal/core/kernel/block_given_spec.rb +30 -0
- data/spec/opal/core/kernel/class_spec.rb +6 -0
- data/spec/opal/core/kernel/define_singleton_method_spec.rb +21 -0
- data/spec/opal/core/kernel/equal_value_spec.rb +12 -0
- data/spec/opal/core/kernel/extend_spec.rb +21 -0
- data/spec/opal/core/kernel/format_spec.rb +122 -0
- data/spec/opal/core/kernel/freeze_spec.rb +15 -0
- data/spec/opal/core/kernel/instance_eval_spec.rb +28 -0
- data/spec/opal/core/kernel/instance_variable_defined_spec.rb +15 -0
- data/spec/opal/core/kernel/instance_variable_get_spec.rb +14 -0
- data/spec/opal/core/kernel/instance_variable_set_spec.rb +10 -0
- data/spec/opal/core/kernel/loop_spec.rb +23 -0
- data/spec/opal/core/kernel/match_spec.rb +5 -0
- data/spec/opal/core/kernel/method_spec.rb +31 -0
- data/spec/opal/core/kernel/methods_spec.rb +25 -0
- data/spec/opal/core/kernel/nil_spec.rb +7 -0
- data/spec/opal/core/kernel/p_spec.rb +15 -0
- data/spec/opal/core/kernel/printf_spec.rb +11 -0
- data/spec/opal/core/kernel/proc_spec.rb +13 -0
- data/spec/opal/core/kernel/rand_spec.rb +23 -0
- data/spec/opal/core/kernel/require_tree_spec.rb +7 -0
- data/spec/opal/core/kernel/respond_to_spec.rb +41 -0
- data/spec/opal/core/kernel/send_spec.rb +56 -0
- data/spec/opal/core/kernel/sprintf_spec.rb +5 -0
- data/spec/opal/core/language/block_spec.rb +538 -0
- data/spec/opal/core/language/fixtures/array.rb +11 -0
- data/spec/opal/core/language/fixtures/block.rb +57 -0
- data/spec/opal/core/language/fixtures/break.rb +240 -0
- data/spec/opal/core/language/fixtures/ensure.rb +72 -0
- data/spec/opal/core/language/fixtures/literal_lambda.rb +7 -0
- data/spec/opal/core/language/fixtures/metaclass.rb +33 -0
- data/spec/opal/core/language/fixtures/module.rb +24 -0
- data/spec/opal/core/language/fixtures/next.rb +128 -0
- data/spec/opal/core/language/fixtures/return.rb +118 -0
- data/spec/opal/core/language/fixtures/send.rb +110 -0
- data/spec/opal/core/language/fixtures/send_1.9.rb +22 -0
- data/spec/opal/core/language/fixtures/super.rb +308 -0
- data/spec/opal/core/language/fixtures/variables.rb +58 -0
- data/spec/opal/core/language/fixtures/yield.rb +28 -0
- data/spec/opal/core/language/predefined_spec.rb +85 -0
- data/spec/opal/core/language/proc_spec.rb +263 -0
- data/spec/opal/core/language/regexp_spec.rb +20 -0
- data/spec/opal/core/language/send_spec.rb +225 -0
- data/spec/opal/core/language/string_spec.rb +44 -0
- data/spec/opal/core/language/symbol_spec.rb +40 -0
- data/spec/opal/core/language/variables_spec.rb +1366 -0
- data/spec/opal/core/language/versions/array_1.9.rb +39 -0
- data/spec/opal/core/language/versions/block_1.9.rb +0 -0
- data/spec/opal/core/language/versions/break_1.9.rb +0 -0
- data/spec/opal/core/language/versions/case_1.9.rb +20 -0
- data/spec/opal/core/language/versions/hash_1.9.rb +18 -0
- data/spec/opal/core/language/versions/literal_lambda_1.9.rb +143 -0
- data/spec/opal/core/language/versions/not_1.9.rb +22 -0
- data/spec/opal/core/language/versions/send_1.9.rb +241 -0
- data/spec/opal/core/language/versions/symbol_1.9.rb +15 -0
- data/spec/opal/core/language/versions/variables_1.9.rb +8 -0
- data/spec/opal/core/module/alias_method_spec.rb +28 -0
- data/spec/opal/core/module/ancestors_spec.rb +11 -0
- data/spec/opal/core/module/append_features_spec.rb +14 -0
- data/spec/opal/core/module/attr_accessor_spec.rb +26 -0
- data/spec/opal/core/module/const_defined_spec.rb +85 -0
- data/spec/opal/core/module/const_get_spec.rb +85 -0
- data/spec/opal/core/module/const_missing_spec.rb +17 -0
- data/spec/opal/core/module/const_set_spec.rb +64 -0
- data/spec/opal/core/module/constants_spec.rb +49 -0
- data/spec/opal/core/module/fixtures/classes.rb +434 -0
- data/spec/opal/core/module/method_defined_spec.rb +48 -0
- data/spec/opal/core/module/module_function_spec.rb +25 -0
- data/spec/opal/core/module/name_spec.rb +52 -0
- data/spec/opal/core/module/public_method_defined_spec.rb +18 -0
- data/spec/opal/core/module/remove_const_spec.rb +22 -0
- data/spec/opal/core/module/undef_method_spec.rb +66 -0
- data/spec/opal/core/numeric/bit_and_spec.rb +7 -0
- data/spec/opal/core/numeric/bit_or_spec.rb +8 -0
- data/spec/opal/core/numeric/bit_xor_spec.rb +6 -0
- data/spec/opal/core/numeric/ceil_spec.rb +8 -0
- data/spec/opal/core/numeric/chr_spec.rb +8 -0
- data/spec/opal/core/numeric/comparison_spec.rb +24 -0
- data/spec/opal/core/numeric/complement_spec.rb +8 -0
- data/spec/opal/core/numeric/divide_spec.rb +10 -0
- data/spec/opal/core/numeric/eql_spec.rb +9 -0
- data/spec/opal/core/numeric/exponent_spec.rb +33 -0
- data/spec/opal/core/numeric/floor_spec.rb +8 -0
- data/spec/opal/core/numeric/gt_spec.rb +11 -0
- data/spec/opal/core/numeric/gte_spec.rb +12 -0
- data/spec/opal/core/numeric/integer_spec.rb +9 -0
- data/spec/opal/core/numeric/left_shift_spec.rb +21 -0
- data/spec/opal/core/numeric/lt_spec.rb +11 -0
- data/spec/opal/core/numeric/lte_spec.rb +12 -0
- data/spec/opal/core/numeric/minus_spec.rb +8 -0
- data/spec/opal/core/numeric/modulo_spec.rb +19 -0
- data/spec/opal/core/numeric/multiply_spec.rb +9 -0
- data/spec/opal/core/numeric/next_spec.rb +9 -0
- data/spec/opal/core/numeric/ord_spec.rb +9 -0
- data/spec/opal/core/numeric/plus_spec.rb +8 -0
- data/spec/opal/core/numeric/pred_spec.rb +7 -0
- data/spec/opal/core/numeric/right_shift_spec.rb +25 -0
- data/spec/opal/core/numeric/step_spec.rb +11 -0
- data/spec/opal/core/numeric/succ_spec.rb +9 -0
- data/spec/opal/core/numeric/times_spec.rb +36 -0
- data/spec/opal/core/numeric/to_f_spec.rb +7 -0
- data/spec/opal/core/numeric/to_i_spec.rb +7 -0
- data/spec/opal/core/numeric/to_json_spec.rb +8 -0
- data/spec/opal/core/numeric/to_s_spec.rb +26 -0
- data/spec/opal/core/numeric/uminus_spec.rb +9 -0
- data/spec/opal/core/numeric/upto_spec.rb +19 -0
- data/spec/opal/core/numeric/zero_spec.rb +7 -0
- data/spec/opal/core/proc/call_spec.rb +21 -0
- data/spec/opal/core/proc/element_reference_spec.rb +21 -0
- data/spec/opal/core/proc/proc_tricks_spec.rb +7 -0
- data/spec/opal/core/runtime/begin_spec.rb +39 -0
- data/spec/opal/core/runtime/block_send_spec.rb +28 -0
- data/spec/opal/core/runtime/block_spec.rb +23 -0
- data/spec/opal/core/runtime/bridged_classes_spec.rb +64 -0
- data/spec/opal/core/runtime/constants_spec.rb +13 -0
- data/spec/opal/core/runtime/eval_spec.rb +5 -0
- data/spec/opal/core/runtime/main_methods_spec.rb +27 -0
- data/spec/opal/core/runtime/method_missing_spec.rb +62 -0
- data/spec/opal/core/runtime/method_spec.rb +31 -0
- data/spec/opal/core/runtime/operator_call_spec.rb +13 -0
- data/spec/opal/core/runtime/paren_spec.rb +14 -0
- data/spec/opal/core/runtime/rescue_spec.rb +38 -0
- data/spec/opal/core/runtime/return_spec.rb +38 -0
- data/spec/opal/core/runtime/send_spec.rb +34 -0
- data/spec/opal/core/runtime/singleton_class_spec.rb +13 -0
- data/spec/opal/core/runtime/super_spec.rb +212 -0
- data/spec/opal/core/runtime/truthy_spec.rb +23 -0
- data/spec/opal/core/runtime/variables_spec.rb +20 -0
- data/spec/opal/core/source_map_spec.rb +15 -0
- data/spec/opal/core/string_spec.rb +11 -0
- data/spec/opal/stdlib/erb/erb_spec.rb +30 -0
- data/spec/opal/stdlib/erb/inline_block.opalerb +3 -0
- data/spec/opal/stdlib/erb/quoted.opalerb +1 -0
- data/spec/opal/stdlib/erb/simple.opalerb +1 -0
- data/spec/opal/stdlib/json/ext_spec.rb +48 -0
- data/spec/opal/stdlib/json/parse_spec.rb +33 -0
- data/spec/opal/stdlib/native/alias_native_spec.rb +27 -0
- data/spec/opal/stdlib/native/each_spec.rb +13 -0
- data/spec/opal/stdlib/native/element_reference_spec.rb +16 -0
- data/spec/opal/stdlib/native/exposure_spec.rb +33 -0
- data/spec/opal/stdlib/native/ext_spec.rb +19 -0
- data/spec/opal/stdlib/native/initialize_spec.rb +17 -0
- data/spec/opal/stdlib/native/method_missing_spec.rb +51 -0
- data/spec/opal/stdlib/native/native_reader_spec.rb +22 -0
- data/spec/opal/stdlib/native/native_writer_spec.rb +30 -0
- data/spec/opal/stdlib/native/new_spec.rb +8 -0
- data/spec/opal/stdlib/promise/error_spec.rb +15 -0
- data/spec/opal/stdlib/promise/rescue_spec.rb +35 -0
- data/spec/opal/stdlib/promise/then_spec.rb +54 -0
- data/spec/opal/stdlib/promise/trace_spec.rb +35 -0
- data/spec/opal/stdlib/promise/value_spec.rb +15 -0
- data/spec/opal/stdlib/promise/when_spec.rb +34 -0
- data/spec/opal/stdlib/template/paths_spec.rb +10 -0
- data/spec/opal/stdlib/thread/mutex_spec.rb +40 -0
- data/spec/opal/stdlib/thread/thread_queue_spec.rb +32 -0
- data/spec/opal/stdlib/thread/thread_spec.rb +60 -0
- data/spec/rubyspecs +329 -0
- data/spec/spec_helper.rb +42 -0
- data/spec/support/mspec_rspec_adapter.rb +33 -0
- data/spec/support/parser_helpers.rb +37 -0
- data/stdlib/README.md +3 -0
- data/stdlib/base64.rb +152 -0
- data/stdlib/benchmark.rb +10 -0
- data/stdlib/buffer.rb +40 -0
- data/stdlib/buffer/array.rb +66 -0
- data/stdlib/buffer/view.rb +70 -0
- data/stdlib/date.rb +170 -0
- data/stdlib/delegate.rb +29 -0
- data/stdlib/dir.rb +1 -0
- data/stdlib/encoding.rb +166 -0
- data/stdlib/enumerator.rb +1 -0
- data/stdlib/erb.rb +16 -0
- data/stdlib/file.rb +1 -0
- data/stdlib/forwardable.rb +71 -0
- data/stdlib/json.rb +182 -0
- data/stdlib/math.rb +370 -0
- data/stdlib/native.rb +530 -0
- data/stdlib/nodejs.rb +5 -0
- data/stdlib/nodejs/dir.rb +13 -0
- data/stdlib/nodejs/file.rb +98 -0
- data/stdlib/nodejs/fileutils.rb +26 -0
- data/stdlib/nodejs/io.rb +2 -0
- data/stdlib/nodejs/irb.rb +45 -0
- data/stdlib/nodejs/process.rb +16 -0
- data/stdlib/nodejs/require.rb +32 -0
- data/stdlib/nodejs/rubygems.rb +68 -0
- data/stdlib/nodejs/runtime.rb +25 -0
- data/stdlib/nodejs/yaml.rb +11 -0
- data/stdlib/observer.rb +202 -0
- data/stdlib/opal-parser.rb +53 -0
- data/stdlib/opal-source-maps.rb +2 -0
- data/stdlib/ostruct.rb +69 -0
- data/stdlib/pathname.rb +31 -0
- data/stdlib/phantomjs.rb +8 -0
- data/stdlib/pp.rb +12 -0
- data/stdlib/process.rb +10 -0
- data/stdlib/promise.rb +300 -0
- data/stdlib/racc/parser.rb +215 -0
- data/stdlib/rbconfig.rb +20 -0
- data/stdlib/securerandom.rb +12 -0
- data/stdlib/set.rb +116 -0
- data/stdlib/singleton.rb +40 -0
- data/stdlib/source_map.rb +5 -0
- data/stdlib/source_map/map.rb +220 -0
- data/stdlib/source_map/mapping.rb +26 -0
- data/stdlib/source_map/offset.rb +88 -0
- data/stdlib/source_map/version.rb +3 -0
- data/stdlib/source_map/vlq.rb +98 -0
- data/stdlib/sourcemap.rb +1 -0
- data/stdlib/stringio.rb +181 -0
- data/stdlib/strscan.rb +155 -0
- data/stdlib/template.rb +46 -0
- data/stdlib/thread.rb +160 -0
- data/stdlib/time.rb +9 -0
- data/tasks/github.rake +19 -0
- metadata +690 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
opal_filter "StringScanner" do
|
|
2
|
+
fails "StringScanner#[] calls to_int on the given index"
|
|
3
|
+
fails "StringScanner#[] raises a TypeError if the given index is nil"
|
|
4
|
+
fails "StringScanner#[] raises a TypeError when a Range is as argument"
|
|
5
|
+
fails "StringScanner#[] raises a TypeError when a String is as argument"
|
|
6
|
+
|
|
7
|
+
fails "StringScanner#get_byte is not multi-byte character sensitive"
|
|
8
|
+
|
|
9
|
+
fails "StringScanner#pos returns the position of the scan pointer"
|
|
10
|
+
fails "StringScanner#pos returns the position of the scan pointer for multibyte string"
|
|
11
|
+
fails "StringScanner#pos returns 0 in the reset position"
|
|
12
|
+
fails "StringScanner#pos returns the length of the string in the terminate position"
|
|
13
|
+
fails "StringScanner#pos returns the `bytesize` for multibyte string in the terminate position"
|
|
14
|
+
fails "StringScanner#pos= raises a RangeError if position too far backward"
|
|
15
|
+
fails "StringScanner#pos= raises a RangeError when the passed argument is out of range"
|
|
16
|
+
|
|
17
|
+
fails "StringScanner#scan returns the matched string for a multi byte string"
|
|
18
|
+
fails "StringScanner#scan raises a TypeError if pattern isn't a Regexp"
|
|
19
|
+
|
|
20
|
+
fails "StringScanner#pos= can poin position that greater than string length for multibyte string"
|
|
21
|
+
fails "StringScanner#pos= positions from the end if the argument is negative for multibyte string"
|
|
22
|
+
end
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
opal_filter "Struct" do
|
|
2
|
+
fails "Struct includes Enumerable"
|
|
3
|
+
fails "Struct anonymous class instance methods includes Enumerable"
|
|
4
|
+
|
|
5
|
+
fails "Struct#[] fails when it does not know about the requested attribute"
|
|
6
|
+
fails "Struct#[] fails if not passed a string, symbol, or integer"
|
|
7
|
+
|
|
8
|
+
fails "Struct#[]= fails when trying to assign attributes which don't exist"
|
|
9
|
+
|
|
10
|
+
fails "Struct#== returns true if the other has all the same fields"
|
|
11
|
+
fails "Struct#== handles recursive structures by returning false if a difference can be found"
|
|
12
|
+
|
|
13
|
+
fails "Struct#eql? returns false if any corresponding elements are not #eql?"
|
|
14
|
+
fails "Struct#eql? handles recursive structures by returning false if a difference can be found"
|
|
15
|
+
|
|
16
|
+
fails "Struct#hash returns the same fixnum for structs with the same content"
|
|
17
|
+
fails "Struct#hash returns the same value if structs are #eql?"
|
|
18
|
+
fails "Struct#hash returns the same hash for recursive structs"
|
|
19
|
+
|
|
20
|
+
fails "Struct#members does not override the instance accessor method"
|
|
21
|
+
|
|
22
|
+
fails "Struct#to_h returns a Hash with members as keys"
|
|
23
|
+
fails "Struct#to_h returns a Hash that is independent from the struct"
|
|
24
|
+
|
|
25
|
+
fails "Struct#initialize can be overriden"
|
|
26
|
+
|
|
27
|
+
fails "Struct#inspect returns a string representation of some kind"
|
|
28
|
+
|
|
29
|
+
fails "Struct#instance_variables returns an array with one name if an instance variable is added"
|
|
30
|
+
fails "Struct#instance_variables returns an empty array if only attributes are defined"
|
|
31
|
+
|
|
32
|
+
fails "Struct.new fails with too many arguments"
|
|
33
|
+
fails "Struct.new creates a constant in subclass' namespace"
|
|
34
|
+
fails "Struct.new raises a TypeError if object is not a Symbol"
|
|
35
|
+
fails "Struct.new raises a TypeError if object doesn't respond to to_sym"
|
|
36
|
+
fails "Struct.new fails with invalid constant name as first argument"
|
|
37
|
+
fails "Struct.new does not create a constant with symbol as first argument"
|
|
38
|
+
fails "Struct.new creates a new anonymous class with nil first argument"
|
|
39
|
+
fails "Struct.new calls to_str on its first argument (constant name)"
|
|
40
|
+
|
|
41
|
+
fails "Struct#values_at fails when passed unsupported types"
|
|
42
|
+
fails "Struct#values_at returns an array of values"
|
|
43
|
+
|
|
44
|
+
fails "Struct anonymous class instance methods Enumerable methods should work"
|
|
45
|
+
end
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
opal_filter "Time" do
|
|
2
|
+
fails "Time.at passed [Time, Integer] raises a TypeError"
|
|
3
|
+
fails "Time.at passed [Integer, String] raises a TypeError"
|
|
4
|
+
fails "Time.at passed [Integer, nil] raises a TypeError"
|
|
5
|
+
fails "Time.at with a second argument that responds to #to_r coerces using #to_r"
|
|
6
|
+
fails "Time.at with a second argument that responds to #to_int coerces using #to_int"
|
|
7
|
+
fails "Time.at passed [Integer, Numeric] returns a Time object representing the given number of seconds and Float microseconds since 1971-01-01 00:00:00 UTC"
|
|
8
|
+
fails "Time.at passed [Integer, Numeric] returns a Time object representing the given number of seconds and Integer microseconds since 1970-01-01 00:00:00 UTC"
|
|
9
|
+
fails "Time.at passed non-Time, non-Numeric with an argument that responds to #to_r coerces using #to_r"
|
|
10
|
+
fails "Time.at passed non-Time, non-Numeric with an argument that responds to #to_int coerces using #to_int"
|
|
11
|
+
fails "Time.at passed [Integer, Numeric] returns a Time object representing the given number of seconds and Float microseconds since 1970-01-01 00:00:00 UTC"
|
|
12
|
+
fails "Time.at passed non-Time, non-Numeric raises a TypeError with a nil argument"
|
|
13
|
+
fails "Time.at passed non-Time, non-Numeric raises a TypeError with a String argument"
|
|
14
|
+
fails "Time.at passed Time returns a subclass instance"
|
|
15
|
+
fails "Time.at passed Time returns a UTC time if the argument is UTC"
|
|
16
|
+
fails "Time.at passed Time creates a new time object with the value given by time"
|
|
17
|
+
fails "Time.at passed Numeric returns a subclass instance on a Time subclass"
|
|
18
|
+
fails "Time.at passed Numeric returns a Time object representing the given number of Float seconds since 1970-01-01 00:00:00 UTC"
|
|
19
|
+
fails "Time.at passed Numeric returns a Time object representing the given number of Integer seconds since 1970-01-01 00:00:00 UTC"
|
|
20
|
+
|
|
21
|
+
fails "Time#day returns the day of the month for a UTC Time"
|
|
22
|
+
|
|
23
|
+
fails "Time#getgm returns a new time which is the utc representation of time"
|
|
24
|
+
|
|
25
|
+
fails "Time.gm ignores fractional seconds if a passed fractional number of microseconds"
|
|
26
|
+
fails "Time.gm ignores fractional seconds if a passed whole number of microseconds"
|
|
27
|
+
fails "Time.gm handles fractional microseconds as a Rational"
|
|
28
|
+
fails "Time.gm handles fractional microseconds as a Float"
|
|
29
|
+
fails "Time.gm handles microseconds"
|
|
30
|
+
fails "Time.gm handles float arguments"
|
|
31
|
+
fails "Time.gm handles string arguments"
|
|
32
|
+
fails "Time.gm handles years from 0 as such"
|
|
33
|
+
fails "Time.gm returns subclass instances"
|
|
34
|
+
fails "Time.gm raises ArgumentError when given 11 arguments"
|
|
35
|
+
fails "Time.gm raises ArgumentError when given 9 arguments"
|
|
36
|
+
fails "Time.gm handles fractional seconds as a Rational"
|
|
37
|
+
fails "Time.gm handles fractional seconds as a Float"
|
|
38
|
+
fails "Time.gm coerces the second with #to_int"
|
|
39
|
+
fails "Time.gm coerces the minute with #to_int"
|
|
40
|
+
fails "Time.gm coerces the hour with #to_int"
|
|
41
|
+
fails "Time.gm coerces the day with #to_int"
|
|
42
|
+
fails "Time.gm coerces the month with #to_int"
|
|
43
|
+
fails "Time.gm coerces the month with #to_str"
|
|
44
|
+
fails "Time.gm handles a String month given as a short month name"
|
|
45
|
+
fails "Time.gm coerces the year with #to_int"
|
|
46
|
+
fails "Time.gm accepts nil month, day, hour, minute, and second"
|
|
47
|
+
fails "Time.gm creates a time based on given C-style gmtime arguments, interpreted as UTC (GMT)"
|
|
48
|
+
fails "Time.gm creates a time based on given values, interpreted as UTC (GMT)"
|
|
49
|
+
|
|
50
|
+
fails "Time#gmt_offset given negative offset returns a negative offset"
|
|
51
|
+
fails "Time#gmt_offset given positive offset returns a positive offset"
|
|
52
|
+
fails "Time#gmt_offset returns offset as Rational"
|
|
53
|
+
fails "Time#gmt_offset returns the correct offset for New Zealand around daylight savings time change"
|
|
54
|
+
fails "Time#gmt_offset returns the correct offset for Hawaii around daylight savings time change"
|
|
55
|
+
fails "Time#gmt_offset returns the correct offset for US Eastern time zone around daylight savings time change"
|
|
56
|
+
fails "Time#gmt_offset returns the offset in seconds between the timezone of time and UTC"
|
|
57
|
+
|
|
58
|
+
fails "Time#hour returns the hour of the day for a UTC Time"
|
|
59
|
+
|
|
60
|
+
fails "Time#inspect formats the local time following the pattern 'yyyy-MM-dd HH:mm:ss Z'"
|
|
61
|
+
fails "Time#inspect formats the UTC time following the pattern 'yyyy-MM-dd HH:mm:ss UTC'"
|
|
62
|
+
fails "Time#inspect formats the fixed offset time following the pattern 'yyyy-MM-dd HH:mm:ss +/-HHMM'"
|
|
63
|
+
|
|
64
|
+
fails "Time.local ignores fractional seconds if a passed fractional number of microseconds"
|
|
65
|
+
fails "Time.local ignores fractional seconds if a passed whole number of microseconds"
|
|
66
|
+
fails "Time.local handles fractional microseconds as a Rational"
|
|
67
|
+
fails "Time.local handles fractional microseconds as a Float"
|
|
68
|
+
fails "Time.local handles microseconds"
|
|
69
|
+
fails "Time.local returns subclass instances"
|
|
70
|
+
fails "Time.local handles fractional seconds as a Rational"
|
|
71
|
+
fails "Time.local handles fractional seconds as a Float"
|
|
72
|
+
fails "Time.local coerces the month with #to_str"
|
|
73
|
+
fails "Time.local handles a String month given as a short month name"
|
|
74
|
+
fails "Time.local handles years from 0 as such"
|
|
75
|
+
fails "Time.local creates the correct time just after dst change"
|
|
76
|
+
fails "Time.local creates the correct time just before dst change"
|
|
77
|
+
fails "Time.local creates a time based on given C-style gmtime arguments, interpreted in the local time zone"
|
|
78
|
+
fails "Time.local respects rare old timezones"
|
|
79
|
+
fails "Time.local creates a time based on given values, interpreted in the local time zone"
|
|
80
|
+
|
|
81
|
+
fails "Time#- returns a time with the same fixed offset as self"
|
|
82
|
+
fails "Time#- maintains subseconds precision"
|
|
83
|
+
fails "Time#- maintains nanoseconds precision"
|
|
84
|
+
fails "Time#- maintains microseconds precision"
|
|
85
|
+
fails "Time#- maintains precision"
|
|
86
|
+
fails "Time#- tracks nanoseconds"
|
|
87
|
+
fails "Time#- tracks microseconds"
|
|
88
|
+
fails "Time#- tracks microseconds"
|
|
89
|
+
fails "Time#- accepts arguments that can be coerced into Rational"
|
|
90
|
+
fails "Time#- understands negative subtractions"
|
|
91
|
+
|
|
92
|
+
fails "Time#mday returns the day of the month for a UTC Time"
|
|
93
|
+
|
|
94
|
+
fails "Time#mon returns the month of the year for a UTC Time"
|
|
95
|
+
|
|
96
|
+
fails "Time#month returns the month of the year for a UTC Time"
|
|
97
|
+
|
|
98
|
+
fails "Time.mktime respects rare old timezones"
|
|
99
|
+
fails "Time.mktime creates a time based on given values, interpreted in the local time zone"
|
|
100
|
+
fails "Time.mktime creates the correct time just before dst change"
|
|
101
|
+
fails "Time.mktime creates the correct time just after dst change"
|
|
102
|
+
fails "Time.mktime handles fractional seconds as a Rational"
|
|
103
|
+
fails "Time.mktime handles fractional seconds as a Float"
|
|
104
|
+
fails "Time.mktime handles years from 0 as such"
|
|
105
|
+
fails "Time.mktime creates a time based on given C-style gmtime arguments, interpreted in the local time zone"
|
|
106
|
+
fails "Time.mktime coerces the month with #to_str"
|
|
107
|
+
fails "Time.mktime handles a String day"
|
|
108
|
+
fails "Time.mktime interprets all numerals as base 10"
|
|
109
|
+
fails "Time.mktime handles a String month given as a short month name"
|
|
110
|
+
fails "Time.mktime returns subclass instances"
|
|
111
|
+
|
|
112
|
+
fails "Time#eql? returns false if self and other have differing fractional microseconds"
|
|
113
|
+
|
|
114
|
+
fails "Time.inspect formats the local time following the pattern 'yyyy-MM-dd HH:mm:ss Z'"
|
|
115
|
+
fails "Time.inspect formats the fixed offset time following the pattern 'yyyy-MM-dd HH:mm:ss +/-HHMM'"
|
|
116
|
+
|
|
117
|
+
fails "Time#+ maintains subseconds precision"
|
|
118
|
+
fails "Time#+ maintains nanoseconds precision"
|
|
119
|
+
fails "Time#+ maintains microseconds precision"
|
|
120
|
+
fails "Time#+ maintains precision"
|
|
121
|
+
fails "Time#+ tracks nanoseconds"
|
|
122
|
+
fails "Time#+ tracks microseconds"
|
|
123
|
+
fails "Time#+ returns a time with the same fixed offset as self"
|
|
124
|
+
fails "Time#+ accepts arguments that can be coerced into Rational"
|
|
125
|
+
fails "Time#+ increments the time by the specified amount as rational numbers"
|
|
126
|
+
fails "Time#+ adds a negative Float"
|
|
127
|
+
fails "Time#+ is a commutative operator"
|
|
128
|
+
|
|
129
|
+
fails "Time#strftime supports week of year format with %U and %W"
|
|
130
|
+
|
|
131
|
+
fails "Time#to_s formats the local time following the pattern 'yyyy-MM-dd HH:mm:ss Z'"
|
|
132
|
+
fails "Time#to_s formats the fixed offset time following the pattern 'yyyy-MM-dd HH:mm:ss +/-HHMM'"
|
|
133
|
+
fails "Time#to_s formats the UTC time following the pattern 'yyyy-MM-dd HH:mm:ss UTC'"
|
|
134
|
+
|
|
135
|
+
fails "Time#utc returns the utc representation of time"
|
|
136
|
+
fails "Time.utc ignores fractional seconds if a passed fractional number of microseconds"
|
|
137
|
+
fails "Time.utc ignores fractional seconds if a passed whole number of microseconds"
|
|
138
|
+
fails "Time.utc handles fractional microseconds as a Rational"
|
|
139
|
+
fails "Time.utc handles fractional microseconds as a Float"
|
|
140
|
+
fails "Time.utc handles microseconds"
|
|
141
|
+
fails "Time.utc handles float arguments"
|
|
142
|
+
fails "Time.utc handles string arguments"
|
|
143
|
+
fails "Time.utc returns subclass instances"
|
|
144
|
+
fails "Time.utc raises ArgumentError when given 11 arguments"
|
|
145
|
+
fails "Time.utc raises ArgumentError when given 9 arguments"
|
|
146
|
+
fails "Time.utc handles fractional seconds as a Rational"
|
|
147
|
+
fails "Time.utc handles fractional seconds as a Float"
|
|
148
|
+
fails "Time.utc handles years from 0 as such"
|
|
149
|
+
fails "Time.utc coerces the second with #to_int"
|
|
150
|
+
fails "Time.utc coerces the minute with #to_int"
|
|
151
|
+
fails "Time.utc coerces the hour with #to_int"
|
|
152
|
+
fails "Time.utc coerces the day with #to_int"
|
|
153
|
+
fails "Time.utc coerces the month with #to_int"
|
|
154
|
+
fails "Time.utc coerces the month with #to_str"
|
|
155
|
+
fails "Time.utc handles a String month given as a short month name"
|
|
156
|
+
fails "Time.utc coerces the year with #to_int"
|
|
157
|
+
fails "Time.utc accepts nil month, day, hour, minute, and second"
|
|
158
|
+
fails "Time.utc creates a time based on given C-style gmtime arguments, interpreted as UTC (GMT)"
|
|
159
|
+
fails "Time.utc creates a time based on given values, interpreted as UTC (GMT)"
|
|
160
|
+
|
|
161
|
+
fails "Time#utc_offset given negative offset returns a negative offset"
|
|
162
|
+
fails "Time#utc_offset given positive offset returns a positive offset"
|
|
163
|
+
fails "Time#utc_offset returns offset as Rational"
|
|
164
|
+
fails "Time#utc_offset returns the correct offset for New Zealand around daylight savings time change"
|
|
165
|
+
fails "Time#utc_offset returns the correct offset for Hawaii around daylight savings time change"
|
|
166
|
+
fails "Time#utc_offset returns the correct offset for US Eastern time zone around daylight savings time change"
|
|
167
|
+
fails "Time#utc_offset returns the offset in seconds between the timezone of time and UTC"
|
|
168
|
+
|
|
169
|
+
fails "Time#wday returns an integer representing the day of the week, 0..6, with Sunday being 0"
|
|
170
|
+
|
|
171
|
+
fails "Time#year returns the four digit year for a UTC Time as an Integer"
|
|
172
|
+
|
|
173
|
+
# The following specs fail under certain TZ / DST conditions
|
|
174
|
+
fails "Time.utc accepts various year ranges"
|
|
175
|
+
fails "Time.gm accepts various year ranges"
|
|
176
|
+
|
|
177
|
+
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
opal_filter "Kernel#Integer() fix broke mspec" do
|
|
2
|
+
fails "Array#shuffle calls #to_f on the Object returned by #rand"
|
|
3
|
+
fails "Array#shuffle raises a RangeError if the random generator returns a value less than 0.0"
|
|
4
|
+
fails "Array#shuffle raises a RangeError if the random generator returns a value equal to 1.0"
|
|
5
|
+
fails "Array#shuffle raises a RangeError if the random generator returns a value greater than 1.0"
|
|
6
|
+
fails "A singleton class has class Bignum as the superclass of a Bignum instance"
|
|
7
|
+
fails "Hash.[] ignores elements that are arrays of more than 2 elements"
|
|
8
|
+
fails "Hash.[] creates a Hash; values can be provided as a list of value-invalid-pairs in an array"
|
|
9
|
+
fails "Hash#default_proc= raises an error if passed nil"
|
|
10
|
+
fails "ERB::Util.html_escape not escape characters except '& < > \"'"
|
|
11
|
+
end
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
opal_filter "Encoding" do
|
|
2
|
+
fails "Array#inspect raises if inspected result is not default external encoding"
|
|
3
|
+
fails "Array#inspect use US-ASCII encoding if the default external encoding is not ascii compatible"
|
|
4
|
+
fails "Array#inspect use the default external encoding if it is ascii compatible"
|
|
5
|
+
fails "Array#inspect returns a US-ASCII string for an empty Array"
|
|
6
|
+
fails "Array#inspect with encoding returns a US-ASCII string for an empty Array"
|
|
7
|
+
fails "Array#inspect with encoding use the default external encoding if it is ascii compatible"
|
|
8
|
+
fails "Array#inspect with encoding use US-ASCII encoding if the default external encoding is not ascii compatible"
|
|
9
|
+
fails "Array#inspect with encoding raises if inspected result is not default external encoding"
|
|
10
|
+
|
|
11
|
+
fails "Array#join fails for arrays with incompatibly-encoded strings"
|
|
12
|
+
fails "Array#join uses the widest common encoding when other strings are incompatible"
|
|
13
|
+
fails "Array#join uses the first encoding when other strings are compatible"
|
|
14
|
+
fails "Array#join returns a US-ASCII string for an empty Array"
|
|
15
|
+
|
|
16
|
+
fails "Array#to_s raises if inspected result is not default external encoding"
|
|
17
|
+
fails "Array#to_s returns a US-ASCII string for an empty Array"
|
|
18
|
+
fails "Array#to_s use US-ASCII encoding if the default external encoding is not ascii compatible"
|
|
19
|
+
fails "Array#to_s use the default external encoding if it is ascii compatible"
|
|
20
|
+
fails "Array#to_s with encoding raises if inspected result is not default external encoding"
|
|
21
|
+
fails "Array#to_s with encoding returns a US-ASCII string for an empty Array"
|
|
22
|
+
fails "Array#to_s with encoding use US-ASCII encoding if the default external encoding is not ascii compatible"
|
|
23
|
+
fails "Array#to_s with encoding use the default external encoding if it is ascii compatible"
|
|
24
|
+
|
|
25
|
+
fails "String#== ignores encoding difference of compatible string"
|
|
26
|
+
fails "String#== considers encoding difference of incompatible string"
|
|
27
|
+
fails "String#== considers encoding compatibility"
|
|
28
|
+
|
|
29
|
+
fails "String#=== ignores encoding difference of compatible string"
|
|
30
|
+
fails "String#=== considers encoding difference of incompatible string"
|
|
31
|
+
fails "String#=== considers encoding compatibility"
|
|
32
|
+
|
|
33
|
+
fails "String#<=> with String returns -1 if self is bytewise less than other"
|
|
34
|
+
fails "String#<=> with String returns 1 if self is bytewise greater than other"
|
|
35
|
+
fails "String#<=> with String returns 0 if self and other contain identical ASCII-compatible bytes in different encodings"
|
|
36
|
+
fails "String#<=> with String returns 0 with identical ASCII-compatible bytes of different encodings"
|
|
37
|
+
fails "String#<=> with String does not return 0 if self and other contain identical non-ASCII-compatible bytes in different encodings"
|
|
38
|
+
fails "String#<=> with String compares the indices of the encodings when the strings have identical non-ASCII-compatible bytes"
|
|
39
|
+
fails "String#<=> with String ignores encoding difference"
|
|
40
|
+
|
|
41
|
+
fails "String.allocate returns a fully-formed String"
|
|
42
|
+
fails "String.allocate returns a binary String"
|
|
43
|
+
|
|
44
|
+
fails "String#capitalize is locale insensitive (only upcases a-z and only downcases A-Z)"
|
|
45
|
+
|
|
46
|
+
fails "String#chars is unicode aware"
|
|
47
|
+
|
|
48
|
+
fails "String#count returns the number of occurrences of a multi-byte character"
|
|
49
|
+
|
|
50
|
+
fails "String#downcase is locale insensitive (only replaces A-Z)"
|
|
51
|
+
|
|
52
|
+
fails "String#each_char is unicode aware"
|
|
53
|
+
|
|
54
|
+
fails "String#eql? ignores encoding difference of compatible string"
|
|
55
|
+
fails "String#eql? considers encoding difference of incompatible string"
|
|
56
|
+
fails "String#eql? considers encoding compatibility"
|
|
57
|
+
|
|
58
|
+
fails "String#gsub with pattern and block uses the compatible encoding if they are compatible"
|
|
59
|
+
fails "String#gsub with pattern and block raises an Encoding::CompatibilityError if the encodings are not compatible"
|
|
60
|
+
fails "String#gsub with pattern and block replaces the incompatible part properly even if the encodings are not compatible"
|
|
61
|
+
|
|
62
|
+
fails "String#initialize with an argument carries over the encoding invalidity"
|
|
63
|
+
|
|
64
|
+
fails "String#replace carries over the encoding invalidity"
|
|
65
|
+
|
|
66
|
+
fails "String#split with Regexp retains the encoding of the source string"
|
|
67
|
+
fails "String#split with Regexp returns an ArgumentError if an invalid UTF-8 string is supplied"
|
|
68
|
+
fails "String#split with Regexp respects the encoding of the regexp when splitting between characters"
|
|
69
|
+
fails "String#split with Regexp splits a string on each character for a multibyte encoding and empty split"
|
|
70
|
+
|
|
71
|
+
fails "String#upcase is locale insensitive (only replaces a-z)"
|
|
72
|
+
|
|
73
|
+
fails "The defined? keyword for pseudo-variables returns 'expression' for __ENCODING__"
|
|
74
|
+
|
|
75
|
+
# language/magic_comment_spec
|
|
76
|
+
fails "Magic comment can take vim style"
|
|
77
|
+
fails "Magic comment can take Emacs style"
|
|
78
|
+
fails "Magic comment can be after the shebang"
|
|
79
|
+
fails "Magic comment must be the first token of the line"
|
|
80
|
+
fails "Magic comment must be at the first line"
|
|
81
|
+
fails "Magic comment is case-insensitive"
|
|
82
|
+
fails "Magic comment determines __ENCODING__"
|
|
83
|
+
end
|
|
84
|
+
|
|
85
|
+
opal_filter "Regexp.escape" do
|
|
86
|
+
fails "Regexp.escape sets the encoding of the result to US-ASCII if there are only US-ASCII characters present in the input String"
|
|
87
|
+
fails "Regexp.escape sets the encoding of the result to the encoding of the String if any non-US-ASCII characters are present in an input String with valid encoding"
|
|
88
|
+
fails "Regexp.escape sets the encoding of the result to ASCII-8BIT if any non-US-ASCII characters are present in an input String with invalid encoding"
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
opal_filter "Regexp.quote" do
|
|
92
|
+
fails "Regexp.quote sets the encoding of the result to US-ASCII if there are only US-ASCII characters present in the input String"
|
|
93
|
+
fails "Regexp.quote sets the encoding of the result to the encoding of the String if any non-US-ASCII characters are present in an input String with valid encoding"
|
|
94
|
+
fails "Regexp.quote sets the encoding of the result to ASCII-8BIT if any non-US-ASCII characters are present in an input String with invalid encoding"
|
|
95
|
+
end
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
opal_filter "Enumerator as generator" do
|
|
2
|
+
fails "Enumerator#next returns the next element of the enumeration"
|
|
3
|
+
fails "Enumerator#next raises a StopIteration exception at the end of the stream"
|
|
4
|
+
fails "Enumerator#next cannot be called again until the enumerator is rewound"
|
|
5
|
+
|
|
6
|
+
fails "Enumerator#rewind resets the enumerator to its initial state"
|
|
7
|
+
fails "Enumerator#rewind returns self"
|
|
8
|
+
fails "Enumerator#rewind has no effect on a new enumerator"
|
|
9
|
+
fails "Enumerator#rewind has no effect if called multiple, consecutive times"
|
|
10
|
+
fails "Enumerator#rewind does nothing if the object doesn't have a #rewind method"
|
|
11
|
+
fails "Enumerator#rewind works with peek to reset the position"
|
|
12
|
+
fails "Enumerator#rewind calls the enclosed object's rewind method if one exists"
|
|
13
|
+
fails "Enumerator#rewind clears a pending #feed value"
|
|
14
|
+
end
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
opal_filter "Object#frozen" do
|
|
2
|
+
fails "Array#fill raises a RuntimeError on a frozen array"
|
|
3
|
+
fails "Array#fill raises a RuntimeError on an empty frozen array"
|
|
4
|
+
fails "Array#frozen? returns true if array is frozen"
|
|
5
|
+
fails "Array#frozen? returns false for an array being sorted by #sort"
|
|
6
|
+
fails "Array#unshift raises a RuntimeError on a frozen array when the array is modified"
|
|
7
|
+
fails "Array#unshift raises a RuntimeError on a frozen array when the array would not be modified"
|
|
8
|
+
fails "Array#uniq! doesn't yield to the block on a frozen array"
|
|
9
|
+
fails "Array#uniq! raises a RuntimeError on a frozen array when the array would not be modified"
|
|
10
|
+
fails "Array#uniq! raises a RuntimeError on a frozen array when the array is modified"
|
|
11
|
+
fails "Array#sort! raises a RuntimeError on a frozen array"
|
|
12
|
+
fails "Array#slice! raises a RuntimeError on a frozen array"
|
|
13
|
+
fails "Array#shuffle! raises a RuntimeError on a frozen array"
|
|
14
|
+
fails "Array#shift raises a RuntimeError on an empty frozen array"
|
|
15
|
+
fails "Array#shift raises a RuntimeError on a frozen array"
|
|
16
|
+
fails "Array#reverse! raises a RuntimeError on a frozen array"
|
|
17
|
+
fails "Array#reject! raises a RuntimeError on an empty frozen array"
|
|
18
|
+
fails "Array#reject! raises a RuntimeError on a frozen array"
|
|
19
|
+
fails "Array#push raises a RuntimeError on a frozen array"
|
|
20
|
+
fails "Array#pop passed a number n as an argument raises a RuntimeError on a frozen array"
|
|
21
|
+
fails "Array#pop raises a RuntimeError on an empty frozen array"
|
|
22
|
+
fails "Array#pop raises a RuntimeError on a frozen array"
|
|
23
|
+
fails "Array#insert raises a RuntimeError on frozen arrays when the array would not be modified"
|
|
24
|
+
fails "Array#insert raises a RuntimeError on frozen arrays when the array is modified"
|
|
25
|
+
fails "Array#flatten! raises a RuntimeError on frozen arrays when the array would not be modified"
|
|
26
|
+
fails "Array#flatten! raises a RuntimeError on frozen arrays when the array is modified"
|
|
27
|
+
fails "Array#delete raises a RuntimeError on a frozen array"
|
|
28
|
+
fails "Array#delete_if raises a RuntimeError on an empty frozen array"
|
|
29
|
+
fails "Array#delete_if raises a RuntimeError on a frozen array"
|
|
30
|
+
fails "Array#delete_at raises a RuntimeError on a frozen array"
|
|
31
|
+
fails "Array#compact! raises a RuntimeError on a frozen array"
|
|
32
|
+
fails "Array#clear raises a RuntimeError on a frozen array"
|
|
33
|
+
fails "Array#<< raises a RuntimeError on a frozen array"
|
|
34
|
+
fails "Array#[]= raises a RuntimeError on a frozen array"
|
|
35
|
+
fails "Array#map! when frozen raises a RuntimeError when calling #each on the returned Enumerator when empty"
|
|
36
|
+
fails "Array#map! when frozen raises a RuntimeError when calling #each on the returned Enumerator"
|
|
37
|
+
fails "Array#map! when frozen raises a RuntimeError when empty"
|
|
38
|
+
fails "Array#map! when frozen raises a RuntimeError"
|
|
39
|
+
fails "Array#reject! returns an Enumerator if no block given, and the array is frozen"
|
|
40
|
+
fails "Array#replace raises a RuntimeError on a frozen array"
|
|
41
|
+
fails "Array#select! on frozen objects with truthy block keeps elements after any exception"
|
|
42
|
+
fails "Array#select! on frozen objects with truthy block raises a RuntimeError"
|
|
43
|
+
fails "Array#select! on frozen objects with falsy block keeps elements after any exception"
|
|
44
|
+
fails "Array#select! on frozen objects with falsy block raises a RuntimeError"
|
|
45
|
+
fails "Array#clone copies frozen status from the original"
|
|
46
|
+
fails "Array#collect! when frozen raises a RuntimeError when calling #each on the returned Enumerator when empty"
|
|
47
|
+
fails "Array#collect! when frozen raises a RuntimeError when calling #each on the returned Enumerator"
|
|
48
|
+
fails "Array#collect! when frozen raises a RuntimeError when empty"
|
|
49
|
+
fails "Array#collect! when frozen raises a RuntimeError"
|
|
50
|
+
fails "Array#concat raises a RuntimeError when Array is frozen and modification occurs"
|
|
51
|
+
fails "Array#concat raises a RuntimeError when Array is frozen and no modification occurs"
|
|
52
|
+
fails "Array#delete_if returns an Enumerator if no block given, and the array is frozen"
|
|
53
|
+
fails "Array#[]= checks frozen before attempting to coerce arguments"
|
|
54
|
+
fails "Array#keep_if on frozen objects returns an Enumerator if no block is given"
|
|
55
|
+
fails "Array#keep_if on frozen objects with truthy block keeps elements after any exception"
|
|
56
|
+
fails "Array#keep_if on frozen objects with truthy block raises a RuntimeError"
|
|
57
|
+
fails "Array#keep_if on frozen objects with falsy block keeps elements after any exception"
|
|
58
|
+
fails "Array#keep_if on frozen objects with falsy block raises a RuntimeError"
|
|
59
|
+
fails "Array#initialize raises a RuntimeError on frozen arrays"
|
|
60
|
+
fails "Array#initialize_copy raises a RuntimeError on a frozen array"
|
|
61
|
+
|
|
62
|
+
fails "Hash#clear raises a RuntimeError if called on a frozen instance"
|
|
63
|
+
fails "Hash#default_proc= raises a RuntimeError if self is frozen"
|
|
64
|
+
fails "Hash#initialize_copy raises a RuntimeError if called on a frozen instance that would not be modified"
|
|
65
|
+
fails "Hash#initialize_copy raises a RuntimeError if called on a frozen instance that is modified"
|
|
66
|
+
fails "Hash#initialize raises a RuntimeError if called on a frozen instance"
|
|
67
|
+
fails "Hash#store raises a RuntimeError if called on a frozen instance"
|
|
68
|
+
fails "Hash#store duplicates and freezes string keys"
|
|
69
|
+
fails "Hash#default= raises a RuntimeError if called on a frozen instance"
|
|
70
|
+
fails "Hash#delete raises a RuntimeError if called on a frozen instance"
|
|
71
|
+
fails "Hash#delete_if raises a RuntimeError if called on a frozen instance"
|
|
72
|
+
fails "Hash#[]= raises a RuntimeError if called on a frozen instance"
|
|
73
|
+
fails "Hash#keep_if raises a RuntimeError if called on a frozen instance"
|
|
74
|
+
fails "Hash#merge! raises a RuntimeError on a frozen instance that is modified"
|
|
75
|
+
fails "Hash#merge! checks frozen status before coercing an object with #to_hash"
|
|
76
|
+
fails "Hash#merge! raises a RuntimeError on a frozen instance that would not be modified"
|
|
77
|
+
fails "Hash#reject! raises a RuntimeError if called on a frozen instance that is modified"
|
|
78
|
+
fails "Hash#reject! raises a RuntimeError if called on a frozen instance that would not be modified"
|
|
79
|
+
fails "Hash#reject! returns an Enumerator if called on a frozen instance"
|
|
80
|
+
fails "Hash#replace raises a RuntimeError if called on a frozen instance that is modified"
|
|
81
|
+
fails "Hash#replace raises a RuntimeError if called on a frozen instance that would not be modified"
|
|
82
|
+
fails "Hash#select! raises a RuntimeError if called on an empty frozen instance"
|
|
83
|
+
fails "Hash#select! raises a RuntimeError if called on a frozen instance that would not be modified"
|
|
84
|
+
fails "Hash#shift raises a RuntimeError if called on a frozen instance"
|
|
85
|
+
fails "Hash#update raises a RuntimeError on a frozen instance that would not be modified"
|
|
86
|
+
fails "Hash#update checks frozen status before coercing an object with #to_hash"
|
|
87
|
+
fails "Hash#update raises a RuntimeError on a frozen instance that is modified"
|
|
88
|
+
fails "Hash#rehash raises a RuntimeError if called on a frozen instance"
|
|
89
|
+
fails "Hash#[]= duplicates and freezes string keys"
|
|
90
|
+
end
|