opal 0.4.3 → 0.4.4
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.
- data/.rspec +3 -0
- data/.travis.yml +0 -4
- data/README.md +6 -0
- data/Rakefile +30 -6
- data/bin/opal +6 -82
- data/corelib/{opal/array.rb → array.rb} +40 -56
- data/corelib/{opal/basic_object.rb → basic_object.rb} +2 -2
- data/corelib/{opal/boolean.rb → boolean.rb} +0 -8
- data/corelib/class.rb +47 -0
- data/corelib/{opal/comparable.rb → comparable.rb} +0 -0
- data/corelib/{opal/enumerable.rb → enumerable.rb} +208 -141
- data/corelib/{opal/enumerator.rb → enumerator.rb} +3 -3
- data/corelib/{opal/error.rb → error.rb} +1 -0
- data/corelib/{opal/hash.rb → hash.rb} +67 -56
- data/corelib/io.rb +39 -0
- data/corelib/{opal/kernel.rb → kernel.rb} +35 -31
- data/corelib/{opal/class.rb → module.rb} +29 -57
- data/corelib/native.rb +148 -0
- data/corelib/{opal/nil_class.rb → nil_class.rb} +2 -10
- data/corelib/{opal/numeric.rb → numeric.rb} +39 -14
- data/corelib/opal.rb +42 -25
- data/corelib/{opal/proc.rb → proc.rb} +3 -3
- data/corelib/{opal/range.rb → range.rb} +5 -1
- data/corelib/{opal/regexp.rb → regexp.rb} +0 -0
- data/corelib/{opal/runtime.js → runtime.js} +96 -188
- data/corelib/{opal/string.rb → string.rb} +20 -15
- data/corelib/struct.rb +139 -0
- data/corelib/{opal/time.rb → time.rb} +0 -0
- data/lib/opal.rb +4 -0
- data/lib/opal/cli.rb +79 -32
- data/lib/opal/cli_options.rb +91 -0
- data/lib/opal/erb.rb +41 -8
- data/lib/opal/grammar.rb +24 -10
- data/lib/opal/grammar.y +15 -4
- data/lib/opal/grammar_helpers.rb +4 -0
- data/lib/opal/lexer.rb +214 -143
- data/lib/opal/parser.rb +596 -562
- data/lib/opal/require_parser.rb +1 -1
- data/lib/opal/source_map.rb +15 -30
- data/lib/opal/target_scope.rb +24 -5
- data/lib/opal/version.rb +1 -1
- data/mri_spec/cli_spec.rb +18 -0
- data/mri_spec/fixtures/opal_file.rb +2 -0
- data/mri_spec/spec_helper.rb +17 -0
- data/opal.gemspec +5 -2
- data/spec/{rubyspec/filters → filters}/bugs/alias.rb +0 -0
- data/spec/{rubyspec/filters → filters}/bugs/ancestors.rb +0 -0
- data/spec/{rubyspec/filters → filters}/bugs/array.rb +0 -0
- data/spec/filters/bugs/array/combination.rb +11 -0
- data/spec/filters/bugs/array/count.rb +3 -0
- data/spec/filters/bugs/array/delete_if.rb +3 -0
- data/spec/filters/bugs/array/drop.rb +3 -0
- data/spec/filters/bugs/array/drop_while.rb +5 -0
- data/spec/filters/bugs/array/eql.rb +3 -0
- data/spec/filters/bugs/array/flatten.rb +9 -0
- data/spec/filters/bugs/array/minus.rb +5 -0
- data/spec/filters/bugs/array/multipliy.rb +9 -0
- data/spec/filters/bugs/array/new.rb +3 -0
- data/spec/filters/bugs/array/pop.rb +6 -0
- data/spec/filters/bugs/array/rassoc.rb +4 -0
- data/spec/filters/bugs/array/rindex.rb +6 -0
- data/spec/filters/bugs/array/select.rb +3 -0
- data/spec/filters/bugs/array/shift.rb +7 -0
- data/spec/filters/bugs/array/shuffle.rb +11 -0
- data/spec/filters/bugs/array/slice.rb +7 -0
- data/spec/filters/bugs/array/take.rb +3 -0
- data/spec/filters/bugs/array/to_a.rb +3 -0
- data/spec/filters/bugs/array/try_convert.rb +7 -0
- data/spec/filters/bugs/array/uniq.rb +10 -0
- data/spec/filters/bugs/array/zip.rb +4 -0
- data/spec/{rubyspec/filters → filters}/bugs/array_delete.rb +1 -0
- data/spec/{rubyspec/filters → filters}/bugs/array_fetch.rb +0 -0
- data/spec/{rubyspec/filters → filters}/bugs/array_first.rb +0 -0
- data/spec/{rubyspec/filters → filters}/bugs/array_flatten.rb +0 -0
- data/spec/{rubyspec/filters → filters}/bugs/array_intersection.rb +0 -0
- data/spec/{rubyspec/filters → filters}/bugs/array_join.rb +0 -0
- data/spec/{rubyspec/filters → filters}/bugs/break.rb +0 -0
- data/spec/filters/bugs/case.rb +4 -0
- data/spec/{rubyspec/filters → filters}/bugs/coerce_integer.rb +0 -0
- data/spec/filters/bugs/enumerable_sort_by.rb +3 -0
- data/spec/{rubyspec/filters → filters}/bugs/kernel/instance_variables.rb +0 -0
- data/spec/filters/bugs/kernel/rand.rb +4 -0
- data/spec/filters/bugs/language/array.rb +3 -0
- data/spec/filters/bugs/language/block.rb +6 -0
- data/spec/filters/bugs/language/break.rb +3 -0
- data/spec/{rubyspec/filters → filters}/bugs/language/class.rb +3 -0
- data/spec/{rubyspec/filters → filters}/bugs/language/class_variables.rb +0 -0
- data/spec/filters/bugs/language/def.rb +27 -0
- data/spec/filters/bugs/language/defined.rb +3 -0
- data/spec/filters/bugs/language/ensure.rb +4 -0
- data/spec/filters/bugs/language/execution.rb +4 -0
- data/spec/filters/bugs/language/for.rb +18 -0
- data/spec/filters/bugs/language/if.rb +13 -0
- data/spec/filters/bugs/language/loop.rb +4 -0
- data/spec/filters/bugs/language/metaclass.rb +14 -0
- data/spec/filters/bugs/language/module.rb +6 -0
- data/spec/filters/bugs/language/next.rb +3 -0
- data/spec/filters/bugs/language/or.rb +3 -0
- data/spec/filters/bugs/language/order.rb +4 -0
- data/spec/filters/bugs/language/precedence.rb +10 -0
- data/spec/filters/bugs/language/proc.rb +24 -0
- data/spec/filters/bugs/language/redo.rb +5 -0
- data/spec/filters/bugs/language/rescue.rb +9 -0
- data/spec/filters/bugs/language/retry.rb +5 -0
- data/spec/filters/bugs/language/send.rb +10 -0
- data/spec/filters/bugs/language/super.rb +9 -0
- data/spec/filters/bugs/language/until.rb +8 -0
- data/spec/filters/bugs/language/variables.rb +37 -0
- data/spec/filters/bugs/language/while.rb +6 -0
- data/spec/filters/bugs/language/yield.rb +5 -0
- data/spec/{rubyspec/filters → filters}/bugs/module/class_variables.rb +0 -0
- data/spec/filters/bugs/module/method_defined.rb +6 -0
- data/spec/filters/bugs/parser.rb +10 -0
- data/spec/{rubyspec/filters → filters}/bugs/public_methods.rb +1 -0
- data/spec/filters/bugs/return.rb +7 -0
- data/spec/filters/bugs/singleton/instance.rb +4 -0
- data/spec/filters/bugs/source_map.rb +3 -0
- data/spec/filters/bugs/string/center.rb +4 -0
- data/spec/filters/bugs/string/lines.rb +3 -0
- data/spec/{rubyspec/filters → filters}/mspec/mocks.rb +0 -0
- data/spec/{rubyspec/filters → filters}/mspec/ruby_exe.rb +0 -0
- data/spec/{rubyspec/filters → filters}/mspec/should_receive.rb +0 -0
- data/spec/{rubyspec/filters → filters}/parser/block_args.rb +0 -0
- data/spec/{rubyspec/filters → filters}/unsupported/array_subclasses.rb +1 -0
- data/spec/filters/unsupported/frozen.rb +32 -0
- data/spec/filters/unsupported/immutable_strings.rb +3 -0
- data/spec/filters/unsupported/tainted.rb +17 -0
- data/spec/filters/unsupported/trusted.rb +15 -0
- data/spec/opal/class/constants_spec.rb +7 -0
- data/spec/opal/erb/erb_spec.rb +7 -1
- data/spec/opal/erb/inline_block.opalerb +3 -0
- data/spec/opal/hash/allocate_spec.rb +16 -0
- data/spec/opal/hash/new_spec.rb +10 -0
- data/spec/opal/hash/to_s_spec.rb +9 -0
- data/spec/opal/kernel/instance_variable_defined_spec.rb +15 -0
- data/spec/opal/kernel/rand_spec.rb +5 -5
- data/spec/opal/kernel/respond_to_spec.rb +14 -1
- data/spec/opal/language/block_spec.rb +13 -0
- data/spec/opal/language/rescue_spec.rb +27 -0
- data/spec/opal/language/return_spec.rb +38 -0
- data/spec/opal/language/singleton_class_spec.rb +13 -0
- data/spec/opal/language/super_spec.rb +99 -0
- data/spec/opal/language/variables_spec.rb +20 -0
- data/spec/opal/module/attr_accessor_spec.rb +8 -0
- data/spec/opal/module/constants_spec.rb +2 -2
- data/spec/opal/native/alias_native_spec.rb +18 -0
- data/spec/opal/native/each_spec.rb +14 -0
- data/spec/opal/native/element_reference_spec.rb +14 -0
- data/spec/opal/native/method_missing_spec.rb +39 -0
- data/spec/opal/native/new_spec.rb +19 -0
- data/spec/opal/native/nil_spec.rb +14 -0
- data/spec/opal/runtime2/class_hierarchy_spec.rb +2 -2
- data/spec/opal/source_map_spec.rb +3 -7
- data/spec/ospec/main.rb.erb +2 -5
- data/spec/parser/alias_spec.rb +4 -4
- data/spec/parser/and_spec.rb +2 -2
- data/spec/parser/array_spec.rb +6 -6
- data/spec/parser/attrasgn_spec.rb +8 -8
- data/spec/parser/begin_spec.rb +11 -11
- data/spec/parser/block_spec.rb +3 -3
- data/spec/parser/break_spec.rb +4 -4
- data/spec/parser/call_spec.rb +50 -48
- data/spec/parser/class_spec.rb +2 -2
- data/spec/parser/const_spec.rb +1 -1
- data/spec/parser/cvar_spec.rb +1 -1
- data/spec/parser/def_spec.rb +5 -5
- data/spec/parser/gvar_spec.rb +2 -2
- data/spec/parser/hash_spec.rb +4 -4
- data/spec/parser/iasgn_spec.rb +3 -3
- data/spec/parser/if_spec.rb +6 -6
- data/spec/parser/iter_spec.rb +6 -6
- data/spec/parser/lambda_spec.rb +5 -5
- data/spec/parser/lasgn_spec.rb +2 -2
- data/spec/parser/line_spec.rb +2 -2
- data/spec/parser/lvar_spec.rb +5 -5
- data/spec/parser/masgn_spec.rb +1 -1
- data/spec/parser/module_spec.rb +2 -2
- data/spec/parser/not_spec.rb +4 -4
- data/spec/parser/op_asgn1_spec.rb +2 -2
- data/spec/parser/op_asgn2_spec.rb +2 -2
- data/spec/parser/or_spec.rb +2 -2
- data/spec/parser/parse_spec.rb +66 -0
- data/spec/parser/parser_spec.rb +32 -38
- data/spec/parser/regexp_spec.rb +4 -4
- data/spec/parser/return_spec.rb +4 -4
- data/spec/parser/sclass_spec.rb +4 -4
- data/spec/parser/str_spec.rb +3 -3
- data/spec/parser/super_spec.rb +6 -6
- data/spec/parser/undef_spec.rb +3 -3
- data/spec/parser/unless_spec.rb +4 -4
- data/spec/parser/while_spec.rb +3 -3
- data/spec/parser/xstr_spec.rb +3 -3
- data/spec/parser/yield_spec.rb +6 -6
- data/spec/rubyspec/core/array/drop_spec.rb +1 -1
- data/spec/rubyspec/core/array/keep_if_spec.rb +1 -3
- data/spec/rubyspec/core/array/length_spec.rb +1 -3
- data/spec/rubyspec/core/array/map_spec.rb +2 -6
- data/spec/rubyspec/core/array/minus_spec.rb +3 -3
- data/spec/rubyspec/core/array/multiply_spec.rb +14 -16
- data/spec/rubyspec/core/array/new_spec.rb +3 -5
- data/spec/rubyspec/core/array/plus_spec.rb +2 -2
- data/spec/rubyspec/core/array/pop_spec.rb +4 -4
- data/spec/rubyspec/core/array/rassoc_spec.rb +2 -2
- data/spec/rubyspec/core/array/reject_spec.rb +2 -6
- data/spec/rubyspec/core/array/replace_spec.rb +1 -3
- data/spec/rubyspec/core/array/reverse_each_spec.rb +1 -3
- data/spec/rubyspec/core/array/reverse_spec.rb +4 -4
- data/spec/rubyspec/core/array/rindex_spec.rb +1 -1
- data/spec/rubyspec/core/array/select_spec.rb +3 -7
- data/spec/rubyspec/core/array/shared/collect.rb +7 -0
- data/spec/rubyspec/core/array/shared/index.rb +1 -1
- data/spec/rubyspec/core/array/shared/keep_if.rb +3 -0
- data/spec/rubyspec/core/array/shared/length.rb +3 -0
- data/spec/rubyspec/core/array/shared/replace.rb +3 -0
- data/spec/rubyspec/core/array/shared/slice.rb +3 -0
- data/spec/rubyspec/core/array/shuffle_spec.rb +1 -1
- data/spec/rubyspec/core/array/size_spec.rb +1 -3
- data/spec/rubyspec/core/array/slice_spec.rb +4 -6
- data/spec/rubyspec/core/array/sort_spec.rb +2 -2
- data/spec/rubyspec/core/array/to_a_spec.rb +1 -1
- data/spec/rubyspec/core/array/try_convert_spec.rb +7 -7
- data/spec/rubyspec/core/array/uniq_spec.rb +7 -7
- data/spec/rubyspec/core/array/zip_spec.rb +1 -1
- data/spec/rubyspec/core/enumerable/collect_spec.rb +24 -0
- data/spec/rubyspec/core/enumerable/count_spec.rb +35 -19
- data/spec/rubyspec/core/enumerable/find_spec.rb +5 -0
- data/spec/rubyspec/core/hash/each_pair_spec.rb +7 -7
- data/spec/rubyspec/core/hash/each_spec.rb +13 -7
- data/spec/rubyspec/core/module/method_defined_spec.rb +4 -4
- data/spec/rubyspec/core/module/public_method_defined_spec.rb +19 -0
- data/spec/rubyspec/core/module/remove_const_spec.rb +23 -0
- data/spec/rubyspec/core/numeric/step_spec.rb +14 -0
- data/spec/rubyspec/core/string/center_spec.rb +43 -65
- data/spec/rubyspec/core/string/lines_spec.rb +1 -1
- data/spec/rubyspec/core/string/ljust_spec.rb +25 -9
- data/spec/rubyspec/core/string/rjust_spec.rb +26 -10
- data/spec/rubyspec/core/struct/fixtures/classes.rb +26 -0
- data/spec/rubyspec/core/struct/initialize_spec.rb +11 -0
- data/spec/rubyspec/core/struct/new_spec.rb +24 -0
- data/spec/rubyspec/fixtures/constants.rb +7 -0
- data/spec/rubyspec/language/break_spec.rb +1 -1
- data/spec/rubyspec/language/case_spec.rb +30 -30
- data/spec/rubyspec/language/def_spec.rb +34 -34
- data/spec/rubyspec/language/defined_spec.rb +2 -2
- data/spec/rubyspec/language/ensure_spec.rb +2 -2
- data/spec/rubyspec/language/execution_spec.rb +2 -2
- data/spec/rubyspec/language/for_spec.rb +17 -17
- data/spec/rubyspec/language/hash_spec.rb +3 -3
- data/spec/rubyspec/language/if_spec.rb +11 -11
- data/spec/rubyspec/language/loop_spec.rb +3 -3
- data/spec/rubyspec/language/metaclass_spec.rb +14 -14
- data/spec/rubyspec/language/module_spec.rb +6 -6
- data/spec/rubyspec/language/next_spec.rb +5 -5
- data/spec/rubyspec/language/not_spec.rb +1 -1
- data/spec/rubyspec/language/or_spec.rb +1 -1
- data/spec/rubyspec/language/order_spec.rb +3 -5
- data/spec/rubyspec/language/precedence_spec.rb +19 -19
- data/spec/rubyspec/language/proc_spec.rb +29 -29
- data/spec/rubyspec/language/redo_spec.rb +3 -5
- data/spec/rubyspec/language/rescue_spec.rb +7 -7
- data/spec/rubyspec/language/retry_spec.rb +2 -2
- data/spec/rubyspec/language/return_spec.rb +12 -12
- data/spec/rubyspec/language/send_spec.rb +9 -9
- data/spec/rubyspec/language/singleton_class_spec.rb +3 -4
- data/spec/rubyspec/language/super_spec.rb +7 -11
- data/spec/rubyspec/language/until_spec.rb +10 -10
- data/spec/rubyspec/language/variables_spec.rb +59 -67
- data/spec/rubyspec/language/versions/array_1.9.rb +1 -1
- data/spec/rubyspec/language/versions/block_1.9.rb +0 -0
- data/spec/rubyspec/language/versions/break_1.9.rb +0 -0
- data/spec/rubyspec/language/versions/literal_lambda_1.9.rb +12 -12
- data/spec/rubyspec/language/versions/send_1.9.rb +23 -23
- data/spec/rubyspec/language/versions/symbol_1.9.rb +2 -2
- data/spec/rubyspec/language/versions/variables_1.9.rb +1 -1
- data/spec/rubyspec/language/while_spec.rb +4 -4
- data/spec/rubyspec/language/yield_spec.rb +3 -3
- data/spec/rubyspec/library/erb/util/html_escape_spec.rb +10 -0
- data/spec/rubyspec/library/singleton/clone_spec.rb +8 -0
- data/spec/rubyspec/library/singleton/dup_spec.rb +8 -0
- data/spec/rubyspec/library/singleton/fixtures/classes.rb +18 -0
- data/spec/rubyspec/library/singleton/instance_spec.rb +30 -0
- data/spec/spec_helper.rb +214 -0
- data/stdlib/buffer.rb +40 -0
- data/stdlib/buffer/array.rb +66 -0
- data/stdlib/buffer/view.rb +70 -0
- data/stdlib/erb.rb +11 -20
- data/stdlib/forwardable.rb +71 -0
- data/stdlib/json.rb +78 -0
- data/stdlib/ostruct.rb +69 -0
- data/stdlib/rbconfig.rb +1 -0
- data/stdlib/singleton.rb +40 -0
- data/stdlib/stringio.rb +173 -0
- data/stdlib/template.rb +44 -0
- metadata +285 -79
- data/corelib/opal/native.rb +0 -31
- data/spec/opal/class/bridge_class_spec.rb +0 -39
- data/spec/opal/native_spec.rb +0 -209
- data/spec/ospec/runner.rb +0 -223
- data/spec/rubyspec/filters/bugs/block_args.rb +0 -3
- data/spec/rubyspec/filters/bugs/case.rb +0 -8
- data/spec/rubyspec/filters/bugs/language/module.rb +0 -3
- data/spec/rubyspec/filters/unsupported/frozen.rb +0 -4
- data/spec/rubyspec/filters/unsupported/tainted.rb +0 -7
@@ -0,0 +1,6 @@
|
|
1
|
+
opal_filter "block" do
|
2
|
+
fails "A block arguments with _ assigns the first variable named"
|
3
|
+
fails "A block arguments with _ extracts arguments with _"
|
4
|
+
fails "A block taking |*a| arguments does not call #to_ary to convert a single yielded object to an Array"
|
5
|
+
fails "A block taking |*| arguments does not call #to_ary to convert a single yielded object to an Array"
|
6
|
+
end
|
@@ -6,4 +6,7 @@ opal_filter "class" do
|
|
6
6
|
fails "A class definition extending an object (sclass) raises a TypeError when trying to extend numbers"
|
7
7
|
fails "A class definition extending an object (sclass) allows accessing the block of the original scope"
|
8
8
|
fails "A class definition extending an object (sclass) can use return to cause the enclosing method to return"
|
9
|
+
fails "An outer class definition contains the inner classes"
|
10
|
+
fails "An outer class definition contains the inner classes"
|
11
|
+
fails "A class definition stores instance variables defined in the class body in the class object"
|
9
12
|
end
|
File without changes
|
@@ -0,0 +1,27 @@
|
|
1
|
+
opal_filter "def" do
|
2
|
+
fails "The def keyword within a closure looks outside the closure for the visibility"
|
3
|
+
fails "a method definition that sets more than one default parameter all to the same value treats the argument after the multi-parameter normally"
|
4
|
+
fails "a method definition that sets more than one default parameter all to the same value only allows overriding the default value of the first such parameter in each set"
|
5
|
+
fails "A method definition in an eval creates a singleton method"
|
6
|
+
fails "A method definition in an eval creates a class method"
|
7
|
+
fails "A method definition in an eval creates an instance method"
|
8
|
+
fails "A method definition inside an instance_eval creates a class method when the receiver is a class"
|
9
|
+
fails "A method definition inside a metaclass scope raises RuntimeError if frozen"
|
10
|
+
fails "A singleton method defined with extreme default arguments may use a lambda as a default"
|
11
|
+
fails "A singleton method defined with extreme default arguments may use preceding arguments as defaults"
|
12
|
+
fails "A singleton method defined with extreme default arguments evaluates the defaults in the singleton scope"
|
13
|
+
fails "A singleton method defined with extreme default arguments may use an fcall as a default"
|
14
|
+
fails "A singleton method defined with extreme default arguments may use a method definition as a default"
|
15
|
+
fails "A method defined with extreme default arguments may use an fcall as a default"
|
16
|
+
fails "A method defined with extreme default arguments can redefine itself when the default is evaluated"
|
17
|
+
fails "Redefining a singleton method does not inherit a previously set visibility"
|
18
|
+
fails "Redefining a singleton method does not inherit a previously set visibility"
|
19
|
+
fails "A singleton method definition raises RuntimeError if frozen"
|
20
|
+
fails "A singleton method definition can be declared for a class variable"
|
21
|
+
fails "A singleton method definition can be declared for a global variable"
|
22
|
+
fails "A singleton method definition can be declared for an instance variable"
|
23
|
+
fails "A singleton method definition can be declared for a local variable"
|
24
|
+
fails "Defining an 'initialize' method sets the method's visibility to private"
|
25
|
+
fails "Defining an 'initialize_copy' method sets the method's visibility to private"
|
26
|
+
|
27
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
opal_filter "for" do
|
2
|
+
fails "The for expression repeats current iteration with 'redo'"
|
3
|
+
fails "The for expression starts the next iteration with 'next'"
|
4
|
+
fails "The for expression allows 'break' to have an argument which becomes the value of the for expression"
|
5
|
+
fails "The for expression breaks out of a loop upon 'break', returning nil"
|
6
|
+
fails "The for expression returns expr"
|
7
|
+
fails "The for expression executes code in containing variable scope with 'do'"
|
8
|
+
fails "The for expression executes code in containing variable scope"
|
9
|
+
fails "The for expression allows body begin on the same line if do is used"
|
10
|
+
fails "The for expression optionally takes a 'do' after the expression"
|
11
|
+
fails "The for expression yields only as many values as there are arguments"
|
12
|
+
fails "The for expression allows a constant as an iterator name"
|
13
|
+
fails "The for expression allows a class variable as an iterator name"
|
14
|
+
fails "The for expression allows an instance variable as an iterator name"
|
15
|
+
fails "The for expression iterates over any object responding to 'each'"
|
16
|
+
fails "The for expression iterates over an Hash passing each key-value pair to the block"
|
17
|
+
fails "The for expression iterates over an Enumerable passing each element to the block"
|
18
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
opal_filter "if" do
|
2
|
+
fails "The if expression with a boolean range ('flip-flop' operator) keeps flip-flops from interfering"
|
3
|
+
fails "The if expression with a boolean range ('flip-flop' operator) scopes state by flip-flop"
|
4
|
+
fails "The if expression with a boolean range ('flip-flop' operator) evaluates the second conditions lazily with exclusive-end range"
|
5
|
+
fails "The if expression with a boolean range ('flip-flop' operator) evaluates the second conditions lazily with inclusive-end range"
|
6
|
+
fails "The if expression with a boolean range ('flip-flop' operator) evaluates the first conditions lazily with exclusive-end range"
|
7
|
+
fails "The if expression with a boolean range ('flip-flop' operator) evaluates the first conditions lazily with inclusive-end range"
|
8
|
+
fails "The if expression with a boolean range ('flip-flop' operator) allows combining two flip-flops"
|
9
|
+
fails "The if expression with a boolean range ('flip-flop' operator) mimics a sed conditional with a many-element exclusive-end range"
|
10
|
+
fails "The if expression with a boolean range ('flip-flop' operator) mimics a sed conditional with a zero-element exclusive-end range"
|
11
|
+
fails "The if expression with a boolean range ('flip-flop' operator) mimics an awk conditional with a many-element inclusive-end range"
|
12
|
+
fails "The if expression with a boolean range ('flip-flop' operator) mimics an awk conditional with a single-element inclusive-end range"
|
13
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
opal_filter "metaclass" do
|
2
|
+
fails "calling methods on the metaclass calls a method defined on the metaclass of the metaclass"
|
3
|
+
fails "calling methods on the metaclass calls a method in deeper chains of metaclasses"
|
4
|
+
fails "A constant on a metaclass is preserved when the object is cloned"
|
5
|
+
fails "A constant on a metaclass is not preserved when the object is duped"
|
6
|
+
fails "A constant on a metaclass does not appear in the object's class constant list"
|
7
|
+
fails "A constant on a metaclass appears in the metaclass constant list"
|
8
|
+
fails "A constant on a metaclass raises a NameError for anonymous_module::CONST"
|
9
|
+
fails "A constant on a metaclass cannot be accessed via object::CONST"
|
10
|
+
fails "A constant on a metaclass is not defined in the metaclass opener's scope"
|
11
|
+
fails "A constant on a metaclass is not defined on the object's class"
|
12
|
+
fails "self in a metaclass body (class << obj) raises a TypeError for symbols"
|
13
|
+
fails "self in a metaclass body (class << obj) raises a TypeError for numbers"
|
14
|
+
end
|
@@ -0,0 +1,6 @@
|
|
1
|
+
opal_filter "module" do
|
2
|
+
fails "The module keyword raises a TypeError if the constant in nil"
|
3
|
+
fails "The module keyword creates a new module with a variable qualified constant name"
|
4
|
+
fails "The module keyword creates a new module with a qualified constant name"
|
5
|
+
fails "The module keyword creates a new module with a non-qualified constant name"
|
6
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
opal_filter "precedence" do
|
2
|
+
fails "Operators or/and have higher precedence than if unless while until modifiers"
|
3
|
+
fails "Operators = %= /= -= += |= &= >>= <<= *= &&= ||= **= have higher precedence than defined? operator"
|
4
|
+
fails "Operators = %= /= -= += |= &= >>= <<= *= &&= ||= **= are right-associative"
|
5
|
+
fails "Operators rescue has higher precedence than ="
|
6
|
+
fails "Operators ? : has higher precedence than rescue"
|
7
|
+
fails "Operators + - have higher precedence than >> <<"
|
8
|
+
fails "Operators + - are left-associative"
|
9
|
+
fails "Operators * / % are left-associative"
|
10
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
opal_filter "proc" do
|
2
|
+
fails "A Proc taking |(a, b)| arguments raises an TypeError if #to_ary does not return an Array"
|
3
|
+
fails "A Proc taking |(a, b)| arguments calls #to_ary to convert a single passed object to an Array"
|
4
|
+
fails "A Proc taking |(a, b)| arguments destructures a single Array value yielded"
|
5
|
+
fails "A Proc taking |(a, b)| arguments raises an ArgumentError when passed no values"
|
6
|
+
fails "A Proc taking |a, | arguments does not call #to_ary to convert a single passed object to an Array"
|
7
|
+
fails "A Proc taking |a, | arguments does not destructure when passed a single Array"
|
8
|
+
fails "A Proc taking |a, | arguments assigns the argument the value passed"
|
9
|
+
fails "A Proc taking |a, | arguments raises an ArgumentError when passed more than one value"
|
10
|
+
fails "A Proc taking |a, | arguments raises an ArgumentError when passed no values"
|
11
|
+
fails "A Proc taking |*a| arguments does not call #to_ary to convert a single passed object to an Array"
|
12
|
+
fails "A Proc taking |*| arguments does not call #to_ary to convert a single passed object to an Array"
|
13
|
+
fails "A Proc taking |*| arguments does not raise an exception when passed multiple values"
|
14
|
+
fails "A Proc taking |*| arguments does not raise an exception when passed no values"
|
15
|
+
fails "A Proc taking |a, *b| arguments does not call #to_ary to convert a single passed object to an Array"
|
16
|
+
fails "A Proc taking |a, *b| arguments raises an ArgumentError if passed no values"
|
17
|
+
fails "A Proc taking |a, b| arguments does not call #to_ary to convert a single passed object to an Array"
|
18
|
+
fails "A Proc taking |a, b| arguments raises an ArgumentError if passed one value"
|
19
|
+
fails "A Proc taking |a, b| arguments raises an ArgumentError if passed no values"
|
20
|
+
fails "A Proc taking |a| arguments raises an ArgumentError if no value is passed"
|
21
|
+
fails "A Proc taking |a| arguments does not call #to_ary to convert a single passed object to an Array"
|
22
|
+
fails "A Proc taking || arguments raises an ArgumentError if a value is passed"
|
23
|
+
fails "A Proc taking zero arguments raises an ArgumentErro if a value is passed"
|
24
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
opal_filter "rescue" do
|
2
|
+
fails "The rescue keyword parses 'a += b rescue c' as 'a += (b rescue c)'"
|
3
|
+
fails "The rescue keyword will not rescue errors raised in an else block in the rescue block above it"
|
4
|
+
fails "The rescue keyword will not execute an else block if an exception was raised"
|
5
|
+
fails "The rescue keyword will execute an else block only if no exceptions were raised"
|
6
|
+
fails "The rescue keyword will only rescue the specified exceptions when doing a splat rescue"
|
7
|
+
fails "The rescue keyword can rescue a splatted list of exceptions"
|
8
|
+
fails "The rescue keyword can rescue multiple raised exceptions with a single rescue block"
|
9
|
+
end
|
@@ -0,0 +1,5 @@
|
|
1
|
+
opal_filter "retry" do
|
2
|
+
fails "The retry statement re-executes the closest block"
|
3
|
+
fails "The retry statement raises a SyntaxError when used outside of a begin statement"
|
4
|
+
fails "The retry keyword inside a begin block's rescue block causes the begin block to be executed again"
|
5
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
opal_filter "send" do
|
2
|
+
fails "Invoking a private getter method does not permit self as a receiver"
|
3
|
+
fails "Invoking a method with manditory and optional arguments raises an ArgumentError if too many values are passed"
|
4
|
+
fails "Invoking a method with optional arguments raises ArgumentError if extra arguments are passed"
|
5
|
+
fails "Invoking a method passes a literal hash without curly braces or parens"
|
6
|
+
fails "Invoking a method passes literal hashes without curly braces as the last parameter"
|
7
|
+
fails "Invoking a method raises a SyntaxError with both a literal block and an object as block"
|
8
|
+
fails "Invoking a method with an object as a block uses 'to_proc' for coercion"
|
9
|
+
fails "Invoking a method with a block makes it available to yield"
|
10
|
+
end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
opal_filter "super" do
|
2
|
+
fails "The super keyword passes along modified rest args when they were originally empty"
|
3
|
+
fails "The super keyword passes along modified rest args when they weren't originally empty"
|
4
|
+
fails "The super keyword sees the included version of a module a method is alias from"
|
5
|
+
fails "The super keyword can't be used with implicit arguments from a method defined with define_method"
|
6
|
+
fails "The super keyword raises an error error when super method does not exist"
|
7
|
+
fails "The super keyword calls the correct method when the method visibility is modified"
|
8
|
+
fails "The super keyword searches class methods including modules"
|
9
|
+
end
|
@@ -0,0 +1,8 @@
|
|
1
|
+
opal_filter "until" do
|
2
|
+
fails "The until modifier with begin .. end block restart the current iteration without reevaluting condition with redo"
|
3
|
+
fails "The until modifier with begin .. end block skips to end of body with next"
|
4
|
+
fails "The until modifier with begin .. end block evaluates condition after block execution"
|
5
|
+
fails "The until modifier with begin .. end block runs block at least once (even if the expression is true)"
|
6
|
+
fails "The until modifier restarts the current iteration without reevaluating condition with redo"
|
7
|
+
fails "The until expression restarts the current iteration without reevaluating condition with redo"
|
8
|
+
end
|
@@ -0,0 +1,37 @@
|
|
1
|
+
opal_filter "variables" do
|
2
|
+
fails "Multiple assignment, array-style returns an array of all rhs values"
|
3
|
+
fails "Multiple assignment has the proper return value"
|
4
|
+
fails "Multiple assignments with grouping supports multiple levels of nested groupings"
|
5
|
+
fails "Multiple assignments with grouping A group on the lhs is considered one position and treats its corresponding rhs position like an Array"
|
6
|
+
fails "Operator assignment 'obj[idx] op= expr' returns result of rhs not result of []="
|
7
|
+
fails "Operator assignment 'obj[idx] op= expr' handles splat index (idx) arguments with normal arguments"
|
8
|
+
fails "Operator assignment 'obj[idx] op= expr' handles multiple splat index (idx) arguments"
|
9
|
+
fails "Operator assignment 'obj[idx] op= expr' handles single splat index (idx) arguments"
|
10
|
+
fails "Operator assignment 'obj[idx] op= expr' handles empty splat index (idx) arguments"
|
11
|
+
fails "Operator assignment 'obj[idx] op= expr' handles complex index (idx) arguments"
|
12
|
+
fails "Operator assignment 'obj[idx] op= expr' handles empty index (idx) arguments"
|
13
|
+
fails "Conditional operator assignment 'obj[idx] op= expr' uses short-circuit arg evaluation"
|
14
|
+
fails "Conditional operator assignment 'obj[idx] op= expr' may not assign at all, depending on the truthiness of lhs"
|
15
|
+
fails "Conditional operator assignment 'obj[idx] op= expr' is equivalent to 'obj[idx] op obj[idx] = expr'"
|
16
|
+
fails "Unconditional operator assignment 'obj[idx] op= expr' is equivalent to 'obj[idx] = obj[idx] op expr'"
|
17
|
+
fails "Conditional operator assignment 'obj.meth op= expr' uses short-circuit arg evaluation"
|
18
|
+
fails "Conditional operator assignment 'obj.meth op= expr' may not assign at all, depending on the truthiness of lhs"
|
19
|
+
fails "Conditional operator assignment 'var op= expr' uses short-circuit arg evaluation"
|
20
|
+
fails "Conditional operator assignment 'var op= expr' may not assign at all, depending on the truthiness of lhs"
|
21
|
+
fails "Assigning multiple values allows complex parallel assignment"
|
22
|
+
fails "Assigning multiple values calls #to_ary on RHS arg if the corresponding LHS var is a splat"
|
23
|
+
fails "Assigning multiple values returns the rhs values used for assignment as an array"
|
24
|
+
fails "Basic multiple assignment with a splatted single RHS value does not call #to_ary on an object"
|
25
|
+
fails "Basic multiple assignment with a splatted single RHS value calls #to_a on an object if #to_ary is not defined"
|
26
|
+
fails "Basic multiple assignment with a splatted single RHS value does not call #to_a on an Array subclass instance"
|
27
|
+
fails "Basic multiple assignment with a splatted single RHS value does not call #to_ary on an Array subclass instance"
|
28
|
+
fails "Basic multiple assignment with a splatted single RHS value does not call #to_a on an Array instance"
|
29
|
+
fails "Basic multiple assignment with a splatted single RHS value does not call #to_ary on an Array instance"
|
30
|
+
fails "Basic multiple assignment with a single RHS value does not call #to_a on an object if #to_ary is not defined"
|
31
|
+
fails "Basic multiple assignment with a single RHS value calls #to_ary on an object"
|
32
|
+
fails "Basic multiple assignment with a single RHS value does not call #to_a on an Array subclass instance"
|
33
|
+
fails "Basic multiple assignment with a single RHS value does not call #to_ary on an Array subclass instance"
|
34
|
+
fails "Basic multiple assignment with a single RHS value does not call #to_a on an Array instance"
|
35
|
+
fails "Basic multiple assignment with a single RHS value does not call #to_ary on an Array instance"
|
36
|
+
fails "Basic assignment allows the assignment of the rhs to the lhs using the rhs splat operator"
|
37
|
+
end
|
@@ -0,0 +1,6 @@
|
|
1
|
+
opal_filter "while" do
|
2
|
+
fails "The while modifier with begin .. end block runs block at least once (even if the expression is false)"
|
3
|
+
fails "The while modifier with begin .. end block evaluates condition after block execution"
|
4
|
+
fails "The while modifier with begin .. end block skips to end of body with next"
|
5
|
+
fails "The while modifier with begin .. end block restarts the current iteration without reevaluting condition with redo"
|
6
|
+
end
|
@@ -0,0 +1,5 @@
|
|
1
|
+
opal_filter "yield" do
|
2
|
+
fails "The yield call taking no arguments ignores assignment to the explicit block argument and calls the passed block"
|
3
|
+
fails "The yield call taking a single splatted argument passes no values when give nil as an argument"
|
4
|
+
fails "The yield call taking multiple arguments with a splat does not pass an argument value if the splatted argument is nil"
|
5
|
+
end
|
File without changes
|
@@ -0,0 +1,6 @@
|
|
1
|
+
opal_filter "Module#method_defined?" do
|
2
|
+
fails "Module#method_defined? converts the given name to a string using to_str"
|
3
|
+
fails "Module#method_defined? raises a TypeError when the given object is not a string/symbol/fixnum"
|
4
|
+
fails "Module#method_defined? does not search Object or Kernel when called on a module"
|
5
|
+
fails "Module#method_defined? returns true if a public or private method with the given name is defined in self, self's ancestors or one of self's included modules"
|
6
|
+
end
|
@@ -0,0 +1,10 @@
|
|
1
|
+
opal_filter "Opal::Parser" do
|
2
|
+
fails "Singleton classes returns an empty s(:scope) when given an empty body"
|
3
|
+
fails "Singleton classes should accept any expressions for singleton part"
|
4
|
+
fails "Strings from %Q construction should match '{' and '}' pairs used to start string before ending match"
|
5
|
+
fails "Strings from %Q construction should match '(' and ')' pairs used to start string before ending match"
|
6
|
+
fails "Strings from %Q construction should match '[' and ']' pairs used to start string before ending match"
|
7
|
+
fails "x-strings created using %x notation should match '{' and '}' pairs used to start string before ending match"
|
8
|
+
fails "x-strings created using %x notation should match '(' and ')' pairs used to start string before ending match"
|
9
|
+
fails "x-strings created using %x notation should match '[' and ']' pairs used to start string before ending match"
|
10
|
+
end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
opal_filter "return" do
|
2
|
+
fails "The return keyword within a begin returns last value returned in nested ensures"
|
3
|
+
fails "The return keyword within a begin executes nested ensures before returning"
|
4
|
+
fails "The return keyword when passed a splat calls 'to_a' on the splatted value first"
|
5
|
+
fails "The return keyword when passed a splat returns an array when used as a splat"
|
6
|
+
fails "The return keyword in a Thread raises a LocalJumpError if used to exit a thread"
|
7
|
+
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,32 @@
|
|
1
|
+
opal_filter "Object#frozen" do
|
2
|
+
fails "Array#frozen? returns true if array is frozen"
|
3
|
+
fails "Array#frozen? returns false for an array being sorted by #sort"
|
4
|
+
fails "Array#unshift raises a RuntimeError on a frozen array when the array is modified"
|
5
|
+
fails "Array#unshift raises a RuntimeError on a frozen array when the array would not be modified"
|
6
|
+
fails "Array#uniq! doesn't yield to the block on a frozen array"
|
7
|
+
fails "Array#uniq! raises a RuntimeError on a frozen array when the array would not be modified"
|
8
|
+
fails "Array#uniq! raises a RuntimeError on a frozen array when the array is modified"
|
9
|
+
fails "Array#sort! raises a RuntimeError on a frozen array"
|
10
|
+
fails "Array#slice! raises a RuntimeError on a frozen array"
|
11
|
+
fails "Array#shuffle! raises a RuntimeError on a frozen array"
|
12
|
+
fails "Array#shift raises a RuntimeError on an empty frozen array"
|
13
|
+
fails "Array#shift raises a RuntimeError on a frozen array"
|
14
|
+
fails "Array#reverse! raises a RuntimeError on a frozen array"
|
15
|
+
fails "Array#reject! raises a RuntimeError on an empty frozen array"
|
16
|
+
fails "Array#reject! raises a RuntimeError on a frozen array"
|
17
|
+
fails "Array#push raises a RuntimeError on a frozen array"
|
18
|
+
fails "Array#pop passed a number n as an argument raises a RuntimeError on a frozen array"
|
19
|
+
fails "Array#pop raises a RuntimeError on an empty frozen array"
|
20
|
+
fails "Array#pop raises a RuntimeError on a frozen array"
|
21
|
+
fails "Array#insert raises a RuntimeError on frozen arrays when the array would not be modified"
|
22
|
+
fails "Array#insert raises a RuntimeError on frozen arrays when the array is modified"
|
23
|
+
fails "Array#flatten! raises a RuntimeError on frozen arrays when the array would not be modified"
|
24
|
+
fails "Array#flatten! raises a RuntimeError on frozen arrays when the array is modified"
|
25
|
+
fails "Array#delete raises a RuntimeError on a frozen array"
|
26
|
+
fails "Array#delete_if raises a RuntimeError on an empty frozen array"
|
27
|
+
fails "Array#delete_if raises a RuntimeError on a frozen array"
|
28
|
+
fails "Array#delete_at raises a RuntimeError on a frozen array"
|
29
|
+
fails "Array#compact! raises a RuntimeError on a frozen array"
|
30
|
+
fails "Array#clear raises a RuntimeError on a frozen array"
|
31
|
+
fails "Array#<< raises a RuntimeError on a frozen array"
|
32
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
opal_filter 'tainted' do
|
2
|
+
fails "Array#clear keeps tainted status"
|
3
|
+
fails "Array#compact! keeps tainted status even if all elements are removed"
|
4
|
+
fails "Array#delete_at keeps tainted status"
|
5
|
+
fails "Array#delete_if keeps tainted status"
|
6
|
+
fails "Array#delete keeps tainted status"
|
7
|
+
fails "Array#shift passed a number n as an argument keeps taint status"
|
8
|
+
fails "Array#shift passed a number n as an argument returns an untainted array even if the array is tainted"
|
9
|
+
fails "Array#pop passed a number n as an argument keeps taint status"
|
10
|
+
fails "Array#pop passed a number n as an argument returns an untainted array even if the array is tainted"
|
11
|
+
fails "Array#pop keeps taint status"
|
12
|
+
fails "Array#+ does not get infected even if an original array is tainted"
|
13
|
+
fails "Array#* with an integer copies the taint status of the original array if the passed count is not 0"
|
14
|
+
fails "Array#* with an integer copies the taint status of the original array even if the array is empty"
|
15
|
+
fails "Array#* with an integer copies the taint status of the original array even if the passed count is 0"
|
16
|
+
fails "Array#compact does not keep tainted status even if all elements are removed"
|
17
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
opal_filter "Object#trusted/untrusted" do
|
2
|
+
fails "Array#pop passed a number n as an argument keeps untrusted status"
|
3
|
+
fails "Array#pop passed a number n as an argument returns a trusted array even if the array is untrusted"
|
4
|
+
fails "Array#pop keeps untrusted status"
|
5
|
+
fails "Array#+ does not infected even if an original array is untrusted"
|
6
|
+
fails "Array#* with an integer copies the untrusted status of the original array if the passed count is not 0"
|
7
|
+
fails "Array#* with an integer copies the untrusted status of the original array even if the array is empty"
|
8
|
+
fails "Array#* with an integer copies the untrusted status of the original array even if the passed count is 0"
|
9
|
+
fails "Array#delete keeps untrusted status"
|
10
|
+
fails "Array#delete_if keeps untrusted status"
|
11
|
+
fails "Array#delete_at keeps untrusted status"
|
12
|
+
fails "Array#compact! keeps untrusted status even if all elements are removed"
|
13
|
+
fails "Array#compact does not keep untrusted status even if all elements are removed"
|
14
|
+
fails "Array#clear keeps untrusted status"
|
15
|
+
end
|