opal 0.9.4 → 0.10.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitattributes +1 -0
- data/.gitignore +2 -3
- data/.gitmodules +5 -2
- data/.jshintrc +1 -8
- data/.rspec +1 -1
- data/.travis.yml +15 -23
- data/CHANGELOG.md +511 -326
- data/CODE_OF_CONDUCT.md +13 -15
- data/CONTRIBUTING.md +26 -216
- data/Gemfile +20 -12
- data/Guardfile +2 -2
- data/HACKING.md +230 -0
- data/README.md +6 -7
- data/bin/opal-mspec +1 -1
- data/config.ru +2 -2
- data/docs/faq.md +1 -1
- data/docs/source_maps.md +1 -1
- data/lib/opal.rb +1 -0
- data/lib/opal/builder.rb +1 -1
- data/lib/opal/cli.rb +30 -28
- data/lib/opal/cli_options.rb +3 -0
- data/lib/opal/cli_runners.rb +14 -1
- data/lib/opal/cli_runners/{apple_script.rb → applescript.rb} +3 -3
- data/lib/opal/cli_runners/nashorn.rb +2 -2
- data/lib/opal/cli_runners/nodejs.rb +2 -2
- data/lib/opal/cli_runners/phantom.js +24 -0
- data/lib/opal/cli_runners/phantomjs.rb +10 -10
- data/lib/opal/cli_runners/server.rb +3 -3
- data/lib/opal/compiler.rb +43 -4
- data/lib/opal/config.rb +3 -1
- data/lib/opal/errors.rb +13 -0
- data/lib/opal/fragment.rb +0 -13
- data/lib/opal/nodes.rb +10 -0
- data/lib/opal/nodes/args/initialize_kwargs.rb +28 -0
- data/lib/opal/nodes/args/kwarg.rb +29 -0
- data/lib/opal/nodes/args/kwoptarg.rb +29 -0
- data/lib/opal/nodes/args/kwrestarg.rb +39 -0
- data/lib/opal/nodes/args/mlhsarg.rb +79 -0
- data/lib/opal/nodes/args/normarg.rb +26 -0
- data/lib/opal/nodes/args/optarg.rb +27 -0
- data/lib/opal/nodes/args/post_args.rb +200 -0
- data/lib/opal/nodes/args/post_kwargs.rb +31 -0
- data/lib/opal/nodes/args/restarg.rb +33 -0
- data/lib/opal/nodes/base.rb +12 -0
- data/lib/opal/nodes/call.rb +92 -33
- data/lib/opal/nodes/def.rb +26 -169
- data/lib/opal/nodes/hash.rb +10 -4
- data/lib/opal/nodes/helpers.rb +6 -3
- data/lib/opal/nodes/inline_args.rb +61 -0
- data/lib/opal/nodes/iter.rb +73 -82
- data/lib/opal/nodes/logic.rb +12 -2
- data/lib/opal/nodes/masgn.rb +1 -2
- data/lib/opal/nodes/node_with_args.rb +141 -0
- data/lib/opal/nodes/rescue.rb +121 -43
- data/lib/opal/nodes/scope.rb +24 -5
- data/lib/opal/nodes/super.rb +122 -54
- data/lib/opal/nodes/top.rb +0 -12
- data/lib/opal/nodes/yield.rb +2 -13
- data/lib/opal/parser.rb +67 -39
- data/lib/opal/parser/grammar.rb +3319 -2961
- data/lib/opal/parser/grammar.y +234 -46
- data/lib/opal/parser/lexer.rb +105 -17
- data/lib/opal/parser/sexp.rb +4 -0
- data/lib/opal/paths.rb +4 -0
- data/lib/opal/regexp_anchors.rb +19 -1
- data/lib/opal/sprockets.rb +21 -18
- data/lib/opal/sprockets/environment.rb +0 -8
- data/lib/opal/sprockets/processor.rb +13 -16
- data/lib/opal/sprockets/server.rb +6 -12
- data/lib/opal/version.rb +1 -1
- data/opal.gemspec +1 -0
- data/opal/corelib/array.rb +209 -131
- data/opal/corelib/basic_object.rb +7 -3
- data/opal/corelib/class.rb +11 -17
- data/opal/corelib/constants.rb +2 -2
- data/opal/corelib/enumerable.rb +178 -355
- data/opal/corelib/enumerator.rb +3 -46
- data/opal/corelib/error.rb +2 -2
- data/opal/corelib/file.rb +13 -1
- data/opal/corelib/hash.rb +26 -56
- data/opal/corelib/helpers.rb +10 -0
- data/opal/corelib/kernel.rb +6 -3
- data/opal/corelib/module.rb +62 -31
- data/opal/corelib/number.rb +7 -16
- data/opal/corelib/proc.rb +24 -9
- data/opal/corelib/range.rb +4 -13
- data/opal/corelib/runtime.js +515 -378
- data/opal/corelib/string.rb +21 -49
- data/opal/corelib/struct.rb +50 -35
- data/opal/corelib/unsupported.rb +18 -30
- data/opal/opal.rb +0 -1
- data/opal/opal/mini.rb +1 -0
- data/spec/README.md +6 -4
- data/spec/filters/bugs/array.rb +0 -42
- data/spec/filters/bugs/basicobject.rb +0 -2
- data/spec/filters/bugs/bigdecimal.rb +160 -0
- data/spec/filters/bugs/class.rb +0 -5
- data/spec/filters/bugs/date.rb +1 -48
- data/spec/filters/bugs/enumerable.rb +4 -12
- data/spec/filters/bugs/enumerator.rb +0 -1
- data/spec/filters/bugs/exception.rb +4 -3
- data/spec/filters/bugs/float.rb +4 -2
- data/spec/filters/bugs/kernel.rb +25 -10
- data/spec/filters/bugs/language.rb +119 -68
- data/spec/filters/bugs/method.rb +135 -0
- data/spec/filters/bugs/module.rb +13 -28
- data/spec/filters/bugs/proc.rb +18 -8
- data/spec/filters/bugs/range.rb +0 -3
- data/spec/filters/bugs/rational.rb +4 -0
- data/spec/filters/bugs/regexp.rb +68 -36
- data/spec/filters/bugs/string.rb +1 -1
- data/spec/filters/bugs/struct.rb +0 -12
- data/spec/filters/bugs/time.rb +1 -0
- data/spec/filters/bugs/unboundmethod.rb +2 -1
- data/spec/filters/unsupported/freeze.rb +3 -1
- data/spec/filters/unsupported/language.rb +0 -7
- data/spec/filters/unsupported/privacy.rb +7 -6
- data/spec/filters/unsupported/string.rb +10 -0
- data/spec/filters/unsupported/struct.rb +3 -0
- data/spec/filters/unsupported/symbol.rb +9 -0
- data/spec/filters/unsupported/taint.rb +0 -3
- data/spec/filters/unsupported/thread.rb +1 -0
- data/spec/lib/cli_runners/phantomjs_spec.rb +39 -0
- data/spec/lib/cli_spec.rb +42 -1
- data/spec/lib/compiler/call_spec.rb +700 -0
- data/spec/lib/compiler_spec.rb +46 -28
- data/spec/lib/config_spec.rb +13 -0
- data/spec/lib/parser/call_spec.rb +18 -0
- data/spec/lib/parser/def_spec.rb +29 -0
- data/spec/lib/parser/iter_spec.rb +15 -15
- data/spec/lib/parser/lambda_spec.rb +153 -12
- data/spec/lib/parser/string_spec.rb +5 -0
- data/spec/lib/parser/undef_spec.rb +1 -1
- data/spec/lib/parser/variables_spec.rb +24 -0
- data/spec/lib/paths_spec.rb +12 -5
- data/spec/lib/spec_helper.rb +5 -0
- data/spec/lib/sprockets/processor_spec.rb +6 -5
- data/spec/lib/sprockets_spec.rb +8 -0
- data/spec/mspec-opal/formatters.rb +188 -0
- data/spec/mspec-opal/runner.rb +193 -0
- data/spec/opal/core/enumerator/with_index_spec.rb +6 -0
- data/spec/opal/core/kernel/define_singleton_method_spec.rb +1 -1
- data/spec/opal/core/kernel/instance_variables_spec.rb +14 -0
- data/spec/opal/core/kernel/loop_spec.rb +1 -1
- data/spec/opal/core/kernel/raise_spec.rb +1 -1
- data/spec/opal/core/language/heredoc_spec.rb +42 -0
- data/spec/opal/core/language/rescue_spec.rb +18 -0
- data/spec/opal/core/language_spec.rb +22 -0
- data/spec/opal/core/module/const_defined_spec.rb +1 -2
- data/spec/opal/core/module/name_spec.rb +6 -0
- data/spec/opal/core/runtime/bridged_classes_spec.rb +14 -2
- data/spec/opal/core/runtime/rescue_spec.rb +12 -2
- data/spec/opal/core/runtime/super_spec.rb +1 -0
- data/spec/opal/core/string_spec.rb +21 -0
- data/spec/opal/stdlib/js_spec.rb +1 -1
- data/spec/opal/stdlib/native/hash_spec.rb +7 -0
- data/spec/opal/stdlib/promise/always_spec.rb +24 -5
- data/spec/opal/stdlib/promise/rescue_spec.rb +15 -6
- data/spec/opal/stdlib/promise/then_spec.rb +13 -5
- data/spec/opal/stdlib/promise/trace_spec.rb +5 -6
- data/spec/opal/stdlib/strscan/scan_spec.rb +1 -1
- data/spec/ruby_specs +122 -0
- data/spec/spec_helper.rb +3 -15
- data/stdlib/base64.rb +51 -121
- data/stdlib/bigdecimal.rb +231 -0
- data/stdlib/bigdecimal/bignumber.js.rb +11 -0
- data/stdlib/bigdecimal/kernel.rb +5 -0
- data/stdlib/date.rb +252 -10
- data/stdlib/native.rb +38 -38
- data/stdlib/nodejs/dir.rb +8 -6
- data/stdlib/nodejs/file.rb +28 -3
- data/stdlib/nodejs/node_modules/.bin/js-yaml +1 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/.bin/esparse +1 -0
- data/stdlib/nodejs/node_modules/js-yaml/node_modules/.bin/esvalidate +1 -0
- data/stdlib/nodejs/require.rb +1 -1
- data/stdlib/nodejs/yaml.rb +3 -2
- data/stdlib/opal-parser.rb +7 -2
- data/stdlib/pathname.rb +23 -1
- data/stdlib/phantomjs.rb +10 -0
- data/stdlib/promise.rb +38 -23
- data/tasks/building.rake +3 -3
- data/tasks/testing.rake +27 -14
- data/tasks/testing/mspec_special_calls.rb +1 -1
- data/tasks/testing/sprockets-phantomjs.js +4 -0
- data/test/opal/test_keyword.rb +110 -110
- data/test/opal/unsupported_and_bugs.rb +30 -0
- data/vendored-minitest/minitest/assertions.rb +1 -1
- metadata +65 -15
- data/.spectator +0 -2
- data/.spectator-mspec +0 -3
- data/opal/corelib/array/inheritance.rb +0 -127
- data/spec/rubyspecs +0 -139
data/spec/filters/bugs/method.rb
CHANGED
@@ -2,4 +2,139 @@ opal_filter "Method" do
|
|
2
2
|
fails "Method#define_method when passed a Method object defines a method with the same #parameters as the original"
|
3
3
|
fails "Method#define_method when passed an UnboundMethod object defines a method with the same #arity as the original"
|
4
4
|
fails "Method#define_method when passed an UnboundMethod object defines a method with the same #parameters as the original"
|
5
|
+
fails "Method#== returns true if methods are the same"
|
6
|
+
fails "Method#== returns true on aliased methods"
|
7
|
+
fails "Method#== returns true if the two core methods are aliases"
|
8
|
+
fails "Method#== returns true if a method was defined using the other one"
|
9
|
+
fails "Method#== missing methods returns true for the same method missing"
|
10
|
+
fails "Method#== missing methods calls respond_to_missing? with true to include private methods"
|
11
|
+
fails "Method#source_location returns an Array"
|
12
|
+
fails "Method#source_location sets the first value to the path of the file in which the method was defined"
|
13
|
+
fails "Method#source_location sets the last value to a Fixnum representing the line on which the method was defined"
|
14
|
+
fails "Method#source_location returns the last place the method was defined"
|
15
|
+
fails "Method#source_location returns the location of the original method even if it was aliased"
|
16
|
+
fails "Method#source_location works for methods defined with a block"
|
17
|
+
fails "Method#source_location works for methods defined with a Method"
|
18
|
+
fails "Method#source_location works for methods defined with an UnboundMethod"
|
19
|
+
fails "Method#source_location works for methods whose visibility has been overridden in a subclass"
|
20
|
+
fails "Method#source_location for a Method generated by respond_to_missing? returns nil"
|
21
|
+
fails "Method#to_proc returns a Proc object with the correct arity"
|
22
|
+
fails "Method#to_proc returns a proc that can be used by define_method"
|
23
|
+
fails "Method#to_proc returns a proc that can receive a block"
|
24
|
+
fails "Method#eql? returns true if methods are the same"
|
25
|
+
fails "Method#eql? returns true on aliased methods"
|
26
|
+
fails "Method#eql? returns true if the two core methods are aliases"
|
27
|
+
fails "Method#eql? returns true if a method was defined using the other one"
|
28
|
+
fails "Method#eql? missing methods returns true for the same method missing"
|
29
|
+
fails "Method#eql? missing methods calls respond_to_missing? with true to include private methods"
|
30
|
+
fails "Method#to_s returns a String containing the method name"
|
31
|
+
fails "Method#to_s returns a String containing the Module the method is defined in"
|
32
|
+
fails "Method#to_s returns a String containing the Module the method is referenced from"
|
33
|
+
fails "Method#unbind returns a String containing the Module the method is defined in"
|
34
|
+
fails "Method#unbind rebinding UnboundMethod to Method's obj produces exactly equivalent Methods"
|
35
|
+
fails "Method#owner returns the class/module it was defined in"
|
36
|
+
fails "Method#owner for a Method generated by respond_to_missing? returns the owner of the method"
|
37
|
+
fails "Method#hash returns the same value for user methods that are eql?"
|
38
|
+
fails "Method#hash returns the same value for builtin methods that are eql?"
|
39
|
+
fails "Method#arity returns negative values for method definition \n def m(a=1) end\n def n(a=1, b=2) end"
|
40
|
+
fails "Method#arity returns negative values for method definition \n def m(a, b=1) end\n def n(a, b, c=1, d=2) end"
|
41
|
+
fails "Method#arity returns negative values for method definition \n def m(a=1, *b) end\n def n(a=1, b=2, *c) end"
|
42
|
+
fails "Method#arity returns negative values for method definition \n def m(*) end\n def n(*a) end"
|
43
|
+
fails "Method#arity returns negative values for method definition \n def m(a, *) end\n def n(a, *b) end\n def o(a, b, *c) end\n def p(a, b, c, *d) end"
|
44
|
+
fails "Method#arity returns negative values for method definition \n def m(*a, b) end\n def n(*a, b, c) end\n def o(*a, b, c, d) end"
|
45
|
+
fails "Method#arity returns negative values for method definition \n def m(a, *b, c) end\n def n(a, b, *c, d, e) end"
|
46
|
+
fails "Method#arity returns negative values for method definition \n def m(a, b=1, c=2, *d, e, f) end\n def n(a, b, c=1, *d, e, f, g) end"
|
47
|
+
fails "Method#arity returns negative values for method definition \n def m(a: 1) end\n def n(a: 1, b: 2) end"
|
48
|
+
fails "Method#arity returns negative values for method definition \n def m(a=1, b: 2) end\n def n(*a, b: 1) end\n def o(a=1, b: 2) end\n def p(a=1, *b, c: 2, &l) end"
|
49
|
+
fails "Method#arity returns negative values for method definition \n def m(**k, &l) end\n def n(*a, **k) end\n def o(a: 1, b: 2, **k) end"
|
50
|
+
fails "Method#arity returns negative values for method definition 'def m(a=1, *b, c:, d: 2, **k, &l) end'"
|
51
|
+
fails "Method#arity returns negative values for method definition \n def m(a, b=1, *c, d, e:, f: 2, **k, &l) end\n def n(a, b=1, *c, d:, e:, f: 2, **k, &l) end\n def o(a=0, b=1, *c, d, e:, f: 2, **k, &l) end\n def p(a=0, b=1, *c, d:, e:, f: 2, **k, &l) end"
|
52
|
+
fails "Method#arity for a Method generated by respond_to_missing? returns -1"
|
53
|
+
fails "Method#name for a Method generated by respond_to_missing? returns the name passed to respond_to_missing?"
|
54
|
+
fails "Method#inspect returns a String containing the Module the method is defined in"
|
55
|
+
fails "Method#[] for a Method generated by respond_to_missing? invokes method_missing with the specified arguments and returns the result"
|
56
|
+
fails "Method#[] for a Method generated by respond_to_missing? invokes method_missing with the method name and the specified arguments"
|
57
|
+
fails "Method#[] for a Method generated by respond_to_missing? invokes method_missing dynamically"
|
58
|
+
fails "Method#[] for a Method generated by respond_to_missing? does not call the original method name even if it now exists"
|
59
|
+
fails "Method#super_method returns the method that would be called by super in the method"
|
60
|
+
fails "Method#super_method returns nil when there's no super method in the parent"
|
61
|
+
fails "Method#super_method returns nil when the parent's method is removed"
|
62
|
+
fails "Method#call for a Method generated by respond_to_missing? invokes method_missing with the specified arguments and returns the result"
|
63
|
+
fails "Method#call for a Method generated by respond_to_missing? invokes method_missing with the method name and the specified arguments"
|
64
|
+
fails "Method#call for a Method generated by respond_to_missing? invokes method_missing dynamically"
|
65
|
+
fails "Method#call for a Method generated by respond_to_missing? does not call the original method name even if it now exists"
|
66
|
+
fails "Method#receiver for a Method generated by respond_to_missing? returns the receiver of the method"
|
67
|
+
fails "Method#curry returns a curried proc"
|
68
|
+
fails "Method#curry with optional arity argument returns a curried proc when given correct arity"
|
69
|
+
fails "Method#curry with optional arity argument raises ArgumentError when the method requires more arguments than the given arity"
|
70
|
+
fails "Method#curry with optional arity argument raises ArgumentError when the method requires less arguments than the given arity"
|
71
|
+
fails "Method#clone returns a copy of the method"
|
72
|
+
fails "Method#parameters returns an empty Array when the method expects no arguments"
|
73
|
+
fails "Method#parameters returns [[:req,:name]] for a method expecting one required argument called 'name'"
|
74
|
+
fails "Method#parameters returns [[:req,:a],[:req,:b]] for a method expecting two required arguments called 'a' and 'b''"
|
75
|
+
fails "Method#parameters returns [[:block,:blk]] for a method expecting one block argument called 'a'"
|
76
|
+
fails "Method#parameters returns [[:req,:a],[:block,:b] for a method expecting a required argument ('a') and a block argument ('b')"
|
77
|
+
fails "Method#parameters returns [[:req,:a],[:req,:b],[:block,:c] for a method expecting two required arguments ('a','b') and a block argument ('c')"
|
78
|
+
fails "Method#parameters returns [[:opt,:a]] for a method expecting one optional argument ('a')"
|
79
|
+
fails "Method#parameters returns [[:req,:a],[:opt,:b]] for a method expecting one required argument ('a') and one optional argument ('b')"
|
80
|
+
fails "Method#parameters returns [[:req,:a],[:opt,:b],[:opt,:c]] for a method expecting one required argument ('a') and two optional arguments ('b','c')"
|
81
|
+
fails "Method#parameters returns [[:req,:a],[:req,:b],[:opt,:c]] for a method expecting two required arguments ('a','b') and one optional arguments ('c')"
|
82
|
+
fails "Method#parameters returns [[:opt,:a],[:block,:b]] for a method expecting one required argument ('a') and one block argument ('b')"
|
83
|
+
fails "Method#parameters returns [[:req,:a],[:opt,:b],[:block,:c]] for a method expecting one required argument ('a'), one optional argument ('b'), and a block ('c')"
|
84
|
+
fails "Method#parameters returns [[:req,:a],[:opt,:b],[:opt,:c],[:block,:d]] for a method expecting one required argument ('a'), two optional arguments ('b','c'), and a block ('d')"
|
85
|
+
fails "Method#parameters returns [[:rest,:a]] for a method expecting a single splat argument ('a')"
|
86
|
+
fails "Method#parameters returns [[:req,:a],[:rest,:b]] for a method expecting a splat argument ('a') and a required argument ('b')"
|
87
|
+
fails "Method#parameters returns [[:req,:a],[:req,:b],[:rest,:c]] for a method expecting two required arguments ('a','b') and a splat argument ('c')"
|
88
|
+
fails "Method#parameters returns [[:req,:a],[:opt,:b],[:rest,:c]] for a method expecting a required argument ('a','b'), an optional argument ('b'), and a splat argument ('c')"
|
89
|
+
fails "Method#parameters returns [[:req,:a],[:req,:b],[:opt,:b],[:rest,:d]] for a method expecting two required arguments ('a','b'), an optional argument ('c'), and a splat argument ('d')"
|
90
|
+
fails "Method#parameters returns [[:req,:a],[:opt,:b],[:opt,:c],[:rest,:d]] for a method expecting a required argument ('a'), two optional arguments ('b','c'), and a splat argument ('d')"
|
91
|
+
fails "Method#parameters returns [[:rest,:a],[:block,:b]] for a method expecting a splat argument ('a') and a block argument ('b')"
|
92
|
+
fails "Method#parameters returns [[:req,:a],[:rest,:b],[:block,:c]] for a method expecting a required argument ('a'), a splat argument ('b'), and a block ('c')"
|
93
|
+
fails "Method#parameters returns [[:req,:a],[:req,:b],[:rest,:c],[:block,:d]] for a method expecting two required arguments ('a','b'), a splat argument ('c'), and a block ('d')"
|
94
|
+
fails "Method#parameters returns [[:req,:a],[:opt,:b],[:rest,:c],[:block,:d]] for a method expecting a required argument ('a'), a splat argument ('c'), and a block ('d')"
|
95
|
+
fails "Method#parameters returns [[:req,:a],[:req,:b],[:opt,:c],[:block,:d]] for a method expecting two required arguments ('a','b'), an optional argument ('c'), a splat argument ('d'), and a block ('e')"
|
96
|
+
fails "Method#parameters returns [[:rest,:a],[:req,:b]] for a method expecting a splat argument ('a') and a required argument ('b')"
|
97
|
+
fails "Method#parameters returns [[:rest,:a],[:req,:b],[:req,:c]] for a method expecting a splat argument ('a') and two required arguments ('b','c')"
|
98
|
+
fails "Method#parameters returns [[:rest,:a],[:req,:b],[:block,:c]] for a method expecting a splat argument ('a'), a required argument ('b'), and a block ('c')"
|
99
|
+
fails "Method#parameters returns [[:key,:a]] for a method with a single optional keyword argument"
|
100
|
+
fails "Method#parameters returns [[:keyrest,:a]] for a method with a keyword rest argument"
|
101
|
+
fails "Method#parameters returns [[:keyreq,:a]] for a method with a single required keyword argument"
|
102
|
+
fails "Method#parameters works with ->(){} as the value of an optional argument"
|
103
|
+
fails "Method#parameters returns [] for a define_method method with explicit no-args || specification"
|
104
|
+
fails "Method#parameters returns [[:rest, :x]] for a define_method method with rest arg 'x' only"
|
105
|
+
fails "Method#parameters returns [[:req, :x]] for a define_method method expecting one required argument 'x'"
|
106
|
+
fails "Method#parameters returns [[:req, :x], [:req, :y]] for a define_method method expecting two required arguments 'x' and 'y'"
|
107
|
+
fails "Method#parameters returns [] for a define_method method with no args specification"
|
108
|
+
fails "Method#parameters returns [[:req]] for a define_method method with a grouping as its only argument"
|
109
|
+
fails "Method#parameters returns [[:opt, :x]] for a define_method method with an optional argument 'x'"
|
110
|
+
fails "Method#parameters returns [[:rest]] for a Method generated by respond_to_missing?"
|
111
|
+
fails "Method#parameters adds nameless rest arg for \"star\" argument"
|
112
|
+
fails "Method#parameters returns the args and block for a splat and block argument"
|
113
|
+
fails "An element assignment method send with a single splatted Object argument does not call #to_ary"
|
114
|
+
fails "An element assignment method send with a single splatted Object argument calls #to_a"
|
115
|
+
fails "An element assignment method send with a single splatted Object argument wraps the argument in an Array if #to_a returns nil"
|
116
|
+
fails "An element assignment method send with a leading splatted Object argument does not call #to_ary"
|
117
|
+
fails "An element assignment method send with a leading splatted Object argument calls #to_a"
|
118
|
+
fails "An element assignment method send with a leading splatted Object argument wraps the argument in an Array if #to_a returns nil"
|
119
|
+
fails "An element assignment method send with a middle splatted Object argument does not call #to_ary"
|
120
|
+
fails "An element assignment method send with a middle splatted Object argument calls #to_a"
|
121
|
+
fails "An element assignment method send with a middle splatted Object argument wraps the argument in an Array if #to_a returns nil"
|
122
|
+
fails "An element assignment method send with a trailing splatted Object argument does not call #to_ary"
|
123
|
+
fails "An element assignment method send with a trailing splatted Object argument calls #to_a"
|
124
|
+
fails "An element assignment method send with a trailing splatted Object argument wraps the argument in an Array if #to_a returns nil"
|
125
|
+
fails "A method assigns local variables from method parameters for definition 'def m(a:) a end'"
|
126
|
+
fails "A method assigns local variables from method parameters for definition 'def m((*), (*)) end'"
|
127
|
+
fails "A method assigns local variables from method parameters for definition 'def m(a=1, (*b), (*c)) [a, b, c] end'"
|
128
|
+
fails "A method assigns local variables from method parameters for definition 'def m(a=1, b:) [a, b] end'"
|
129
|
+
fails "A method assigns local variables from method parameters for definition 'def m(a=1, b: 2) [a, b] end'"
|
130
|
+
fails "A method assigns local variables from method parameters for definition 'def m(a=1, **) a end'"
|
131
|
+
fails "A method assigns local variables from method parameters for definition 'def m(*a, b:) [a, b] end'"
|
132
|
+
fails "A method assigns local variables from method parameters for definition 'def m(*a, b: 1) [a, b] end'"
|
133
|
+
fails "A method assigns local variables from method parameters for definition 'def m(*a, **) a end'"
|
134
|
+
fails "A method assigns local variables from method parameters for definition 'def m(a = nil, **k) [a, k] end'"
|
135
|
+
fails "A method assigns local variables from method parameters for definition 'def m(*a, **k) [a, k] end'"
|
136
|
+
fails "A method assigns local variables from method parameters for definition 'def m(a:, b:) [a, b] end'"
|
137
|
+
fails "A method assigns local variables from method parameters for definition 'def m(a:, b: 1) [a, b] end'"
|
138
|
+
fails "A method assigns local variables from method parameters for definition 'def m(a:, **) a end'"
|
139
|
+
fails "A method assigns local variables from method parameters for definition 'def m(a:, **k) [a, k] end'"
|
5
140
|
end
|
data/spec/filters/bugs/module.rb
CHANGED
@@ -1,11 +1,8 @@
|
|
1
1
|
opal_filter "Module" do
|
2
|
-
fails "Module#=== returns true when the given Object's class includes self or when the given Object is extended by self"
|
3
2
|
fails "Module#alias_method can call a method with super aliased twice"
|
4
3
|
fails "Module#alias_method preserves the arguments information of the original methods"
|
5
4
|
fails "Module#alias_method raises a TypeError when the given name can't be converted using to_str"
|
6
5
|
fails "Module#alias_method retains method visibility"
|
7
|
-
fails "Module#ancestors returns only modules and classes"
|
8
|
-
fails "Module#ancestors when called on a singleton class includes the singleton classes of ancestors"
|
9
6
|
fails "Module#append_features copies own tainted status to the given module"
|
10
7
|
fails "Module#append_features copies own untrusted status to the given module"
|
11
8
|
fails "Module#append_features on Class raises a TypeError if calling after rebinded to Class"
|
@@ -35,7 +32,7 @@ opal_filter "Module" do
|
|
35
32
|
fails "Module#autoload does NOT raise a NameError when the autoload file did not define the constant and a module is opened with the same name"
|
36
33
|
fails "Module#autoload does not load the file if the file is manually required"
|
37
34
|
fails "Module#autoload does not load the file when accessing the constants table of the module"
|
38
|
-
fails "Module#autoload does not load the file when
|
35
|
+
fails "Module#autoload does not load the file when referring to the constant in defined?"
|
39
36
|
fails "Module#autoload does not remove the constant from the constant table if load fails"
|
40
37
|
fails "Module#autoload does not remove the constant from the constant table if the loaded files does not define it"
|
41
38
|
fails "Module#autoload ignores the autoload request if the file is already loaded"
|
@@ -60,7 +57,7 @@ opal_filter "Module" do
|
|
60
57
|
fails "Module#autoload raises an ArgumentError when an empty filename is given"
|
61
58
|
fails "Module#autoload registers a file to load the first time the named constant is accessed"
|
62
59
|
fails "Module#autoload retains the autoload even if the request to require fails"
|
63
|
-
fails "Module#autoload returns 'constant' on
|
60
|
+
fails "Module#autoload returns 'constant' on referring the constant with defined?()"
|
64
61
|
fails "Module#autoload runs for an exception condition class and doesn't trample the exception"
|
65
62
|
fails "Module#autoload sets the autoload constant in the constants table"
|
66
63
|
fails "Module#autoload shares the autoload request across dup'ed copies of modules"
|
@@ -72,7 +69,6 @@ opal_filter "Module" do
|
|
72
69
|
fails "Module#class_eval converts non string eval-string to string using to_str"
|
73
70
|
fails "Module#class_eval defines constants in the receiver's scope"
|
74
71
|
fails "Module#class_eval evaluates a given string in the context of self"
|
75
|
-
fails "Module#class_eval passes the module as the first argument of the block"
|
76
72
|
fails "Module#class_eval raises a TypeError when the given eval-string can't be converted to string using to_str"
|
77
73
|
fails "Module#class_eval raises a TypeError when the given filename can't be converted to string using to_str"
|
78
74
|
fails "Module#class_eval resolves constants in the caller scope ignoring send"
|
@@ -89,27 +85,13 @@ opal_filter "Module" do
|
|
89
85
|
fails "Module#class_variable_defined? returns true if a class variables with the given name is defined in an included module"
|
90
86
|
fails "Module#class_variable_defined? returns true if the class variable is defined in a metaclass"
|
91
87
|
fails "Module#class_variable_get returns the value of a class variable with the given name defined in an included module"
|
92
|
-
fails "Module#class_variable_set sets the value of a class variable with the given name defined in an included module"
|
93
88
|
fails "Module#class_variables does not return class variables defined in extended modules"
|
94
89
|
fails "Module#class_variables returns an Array of Symbols of class variable names defined in a metaclass"
|
95
90
|
fails "Module#class_variables returns an Array with names of class variables defined in metaclasses"
|
96
91
|
fails "Module#class_variables returns an Array with the names of class variables of self"
|
97
|
-
fails "Module#const_get
|
98
|
-
fails "Module#const_get calls #to_str to convert the given name to a String"
|
99
|
-
fails "Module#const_get does not search the singleton class of a Class or Module"
|
100
|
-
fails "Module#const_get raises a NameError if a Symbol is a scoped constant name"
|
101
|
-
fails "Module#const_get raises a NameError if the constant is defined in the receiver's supperclass and the inherit flag is false"
|
102
|
-
fails "Module#const_get raises a TypeError if conversion to a String by calling #to_str fails"
|
103
|
-
fails "Module#const_get with dynamically assigned constants searches a module included in the immediate class before the superclass"
|
104
|
-
fails "Module#const_get with dynamically assigned constants searches a module included in the superclass"
|
105
|
-
fails "Module#const_get with dynamically assigned constants searches the superclass chain"
|
106
|
-
fails "Module#const_missing raises NameError and does not include toplevel Object"
|
107
|
-
fails "Module#const_set calls #to_str to convert the given name to a String"
|
108
|
-
fails "Module#const_set on a frozen module raises a RuntimeError before setting the name"
|
109
|
-
fails "Module#const_set raises a TypeError if conversion to a String by calling #to_str fails"
|
92
|
+
fails "Module#const_get raises a NameError if the constant is defined in the receiver's supperclass and the inherit flag is false" # requires to not copy the whole $$scope on inheriting
|
110
93
|
fails "Module#constants doesn't returns inherited constants when passed false"
|
111
94
|
fails "Module#constants doesn't returns inherited constants when passed nil"
|
112
|
-
fails "Module#constants includes names of constants defined after a module is included"
|
113
95
|
fails "Module#constants returns all constants including inherited when passed some object"
|
114
96
|
fails "Module#constants returns all constants including inherited when passed true"
|
115
97
|
fails "Module#constants returns an array of Symbol names of all constants defined in the module and all included modules"
|
@@ -142,12 +124,8 @@ opal_filter "Module" do
|
|
142
124
|
fails "Module#include detects cyclic includes"
|
143
125
|
fails "Module#include does not override existing constants in modules and classes"
|
144
126
|
fails "Module#include doesn't include module if it is included in a super class"
|
145
|
-
fails "Module#include ignores modules it has already included via module mutual inclusion"
|
146
|
-
fails "Module#include preserves ancestor order"
|
147
|
-
fails "Module#include recursively includes new mixins"
|
148
127
|
fails "Module#include? raises a TypeError when no module was given"
|
149
128
|
fails "Module#include? returns true if the given module is included by self or one of it's ancestors"
|
150
|
-
fails "Module#included_modules returns a list of modules included in self"
|
151
129
|
fails "Module#initialize is called on subclasses"
|
152
130
|
fails "Module#instance_method gives UnboundMethod method name, Module defined in and Module extracted from"
|
153
131
|
fails "Module#instance_method raises a NameError if the method has been undefined"
|
@@ -156,12 +134,18 @@ opal_filter "Module" do
|
|
156
134
|
fails "Module#method_defined? converts the given name to a string using to_str"
|
157
135
|
fails "Module#method_defined? raises a TypeError when the given object is not a string/symbol/fixnum"
|
158
136
|
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"
|
137
|
+
fails "Module#const_defined? returns false if the constant is defined in the receiver's superclass and the inherit flag is false"
|
138
|
+
fails "Module#const_defined? returns true for toplevel constant when the name begins with '::'"
|
139
|
+
fails "Module#const_defined? returns true when passed a scoped constant name"
|
140
|
+
fails "Module#const_defined? returns true when passed a scoped constant name for a constant in the inheritance hierarchy and the inherited flag is default"
|
141
|
+
fails "Module#const_defined? returns true when passed a scoped constant name for a constant in the inheritance hierarchy and the inherited flag is true"
|
142
|
+
fails "Module#const_defined? returns true or false for the nested name"
|
143
|
+
fails "Module#const_defined? returns true when passed a constant name with EUC-JP characters"
|
159
144
|
fails "Module#module_eval adds methods respecting the lexical constant scope"
|
160
145
|
fails "Module#module_eval converts a non-string filename to a string using to_str"
|
161
146
|
fails "Module#module_eval converts non string eval-string to string using to_str"
|
162
147
|
fails "Module#module_eval defines constants in the receiver's scope"
|
163
148
|
fails "Module#module_eval evaluates a given string in the context of self"
|
164
|
-
fails "Module#module_eval passes the module as the first argument of the block"
|
165
149
|
fails "Module#module_eval raises a TypeError when the given eval-string can't be converted to string using to_str"
|
166
150
|
fails "Module#module_eval raises a TypeError when the given filename can't be converted to string using to_str"
|
167
151
|
fails "Module#module_eval resolves constants in the caller scope ignoring send"
|
@@ -171,7 +155,6 @@ opal_filter "Module" do
|
|
171
155
|
fails "Module#module_exec defines method in the receiver's scope"
|
172
156
|
fails "Module#module_function as a toggle (no arguments) in a Module body does not affect module_evaled method definitions also if outside the eval itself"
|
173
157
|
fails "Module#module_function as a toggle (no arguments) in a Module body doesn't affect definitions when inside an eval even if the definitions are outside of it"
|
174
|
-
fails "Module#module_function as a toggle (no arguments) in a Module body functions normally if both toggle and definitions inside a eval"
|
175
158
|
fails "Module#module_function as a toggle (no arguments) in a Module body has no effect if inside a module_eval if the definitions are outside of it"
|
176
159
|
fails "Module#module_function on Class raises a TypeError if calling after rebinded to Class"
|
177
160
|
fails "Module#module_function with specific method names raises a TypeError when the given names can't be converted to string using to_str"
|
@@ -193,6 +176,8 @@ opal_filter "Module" do
|
|
193
176
|
fails "Module#prepend does not affect the superclass"
|
194
177
|
fails "Module#prepend does not import constants"
|
195
178
|
fails "Module#prepend does not import methods to modules and classes"
|
179
|
+
fails "Module#prepend does not interfere with a define_method super in the original class"
|
180
|
+
fails "Module#prepend does not raise a TypeError when the argument is an instance of a subclass of Module"
|
196
181
|
fails "Module#prepend imports instance methods"
|
197
182
|
fails "Module#prepend includes prepended modules in ancestors"
|
198
183
|
fails "Module#prepend inserts a later prepended module into the chain"
|
@@ -232,7 +217,7 @@ opal_filter "Module" do
|
|
232
217
|
fails "Module#remove_const raises a NameError if the name starts with a non-alphabetic character"
|
233
218
|
fails "Module#remove_const raises a TypeError if conversion to a String by calling #to_str fails"
|
234
219
|
fails "Module#remove_const returns nil when removing autoloaded constant"
|
235
|
-
fails "Module.
|
220
|
+
fails "Module.constants returns an array of Symbol names" # requires Bignum
|
236
221
|
fails "Module.constants returns Module's constants when given a parameter"
|
237
222
|
fails "Module.new creates a new Module and passes it to the provided block"
|
238
223
|
fails "Module::Nesting returns the list of Modules nested at the point of call"
|
data/spec/filters/bugs/proc.rb
CHANGED
@@ -4,6 +4,7 @@ opal_filter "Proc" do
|
|
4
4
|
fails "Proc as an implicit block pass argument remains the same object if re-vivified by the target method"
|
5
5
|
fails "Proc#=== on a Proc created with Kernel#lambda or Kernel#proc raises an ArgumentError on excess arguments when self is a lambda"
|
6
6
|
fails "Proc#=== on a Proc created with Kernel#lambda or Kernel#proc raises an ArgumentError on missing arguments when self is a lambda"
|
7
|
+
fails "Proc#arity for instances created with -> () { } returns negative values for definition '@a = -> (a=1, *b, c:, d: 2, **k, &l) { }'"
|
7
8
|
fails "Proc#arity for instances created with -> () { } returns negative values for definition \n @a = -> (*) { }\n @b = -> (*a) { }"
|
8
9
|
fails "Proc#arity for instances created with -> () { } returns negative values for definition \n @a = -> (**k, &l) { }\n @b= -> (*a, **k) { }\n @c = ->(a: 1, b: 2, **k) { }"
|
9
10
|
fails "Proc#arity for instances created with -> () { } returns negative values for definition \n @a = -> (*a, b) { }\n @b = -> (*a, b, c) { }\n @c = -> (*a, b, c, d) { }"
|
@@ -15,12 +16,9 @@ opal_filter "Proc" do
|
|
15
16
|
fails "Proc#arity for instances created with -> () { } returns negative values for definition \n @a = -> (a: 1) { }\n @b = -> (a: 1, b: 2) { }"
|
16
17
|
fails "Proc#arity for instances created with -> () { } returns negative values for definition \n @a = -> (a=1) { }\n @b = -> (a=1, b=2) { }"
|
17
18
|
fails "Proc#arity for instances created with -> () { } returns negative values for definition \n @a = -> (a=1, *b) { }\n @b = -> (a=1, b=2, *c) { }"
|
18
|
-
fails "Proc#arity for instances created with -> () { } returns negative values for definition \n @a = -> (a=1, *b, c:, d: 2, **k, &l) { }"
|
19
19
|
fails "Proc#arity for instances created with -> () { } returns negative values for definition \n @a = -> (a=1, b: 2) { }\n @b = -> (*a, b: 1) { }\n @c = -> (a=1, b: 2) { }\n @d = -> (a=1, *b, c: 2, &l) { }"
|
20
20
|
fails "Proc#arity for instances created with -> () { } returns positive values for definition \n @a = -> ((a, (*b, c))) { }\n @b = -> (a, (*b, c), d, (*e), (*)) { }"
|
21
|
-
fails "Proc#arity for instances created with
|
22
|
-
fails "Proc#arity for instances created with -> () { } returns positive values for definition \n @a = -> (a, b:) { }\n @b = -> (a, b:, &l) { }"
|
23
|
-
fails "Proc#arity for instances created with -> () { } returns positive values for definition \n @a = -> (a:) { }\n @b = -> (a:, b:) { }\n @c = -> (a: 1, b:, c:, d: 2) { }"
|
21
|
+
fails "Proc#arity for instances created with lambda { || } returns negative values for definition '@a = lambda { |a=1, *b, c:, d: 2, **k, &l| }'"
|
24
22
|
fails "Proc#arity for instances created with lambda { || } returns negative values for definition \n @a = lambda { |(a, (*b, c)), d=1| }\n @b = lambda { |a, (*b, c), d, (*e), (*), **k| }\n @c = lambda { |a, (b, c), *, d:, e: 2, **| }"
|
25
23
|
fails "Proc#arity for instances created with lambda { || } returns negative values for definition \n @a = lambda { |**k, &l| }\n @b = lambda { |*a, **k| }\n @c = lambda { |a: 1, b: 2, **k| }"
|
26
24
|
fails "Proc#arity for instances created with lambda { || } returns negative values for definition \n @a = lambda { |*a, b| }\n @b = lambda { |*a, b, c| }\n @c = lambda { |*a, b, c, d| }"
|
@@ -31,13 +29,9 @@ opal_filter "Proc" do
|
|
31
29
|
fails "Proc#arity for instances created with lambda { || } returns negative values for definition \n @a = lambda { |a, b=1, c=2, *d, e, f| }\n @b = lambda { |a, b, c=1, *d, e, f, g| }"
|
32
30
|
fails "Proc#arity for instances created with lambda { || } returns negative values for definition \n @a = lambda { |a, b=1| }\n @b = lambda { |a, b, c=1, d=2| }"
|
33
31
|
fails "Proc#arity for instances created with lambda { || } returns negative values for definition \n @a = lambda { |a: 1| }\n @b = lambda { |a: 1, b: 2| }"
|
34
|
-
fails "Proc#arity for instances created with lambda { || } returns negative values for definition \n @a = lambda { |a=1, *b, c:, d: 2, **k, &l| }"
|
35
32
|
fails "Proc#arity for instances created with lambda { || } returns negative values for definition \n @a = lambda { |a=1, *b| }\n @b = lambda { |a=1, b=2, *c| }"
|
36
33
|
fails "Proc#arity for instances created with lambda { || } returns negative values for definition \n @a = lambda { |a=1, b: 2| }\n @b = lambda { |*a, b: 1| }\n @c = lambda { |a=1, b: 2| }\n @d = lambda { |a=1, *b, c: 2, &l| }"
|
37
34
|
fails "Proc#arity for instances created with lambda { || } returns negative values for definition \n @a = lambda { |a=1| }\n @b = lambda { |a=1, b=2| }"
|
38
|
-
fails "Proc#arity for instances created with lambda { || } returns positive values for definition \n @a = lambda { |a, b, c:, d: 1| }\n @b = lambda { |a, b, c:, d: 1, **k, &l| }"
|
39
|
-
fails "Proc#arity for instances created with lambda { || } returns positive values for definition \n @a = lambda { |a, b:| }\n @b = lambda { |a, b:, &l| }"
|
40
|
-
fails "Proc#arity for instances created with lambda { || } returns positive values for definition \n @a = lambda { |a:| }\n @b = lambda { |a:, b:| }\n @c = lambda { |a: 1, b:, c:, d: 2| }"
|
41
35
|
fails "Proc#binding returns a Binding instance"
|
42
36
|
fails "Proc#binding returns the binding associated with self"
|
43
37
|
fails "Proc#call on a Proc created with Kernel#lambda or Kernel#proc raises an ArgumentError on excess arguments when self is a lambda"
|
@@ -69,4 +63,20 @@ opal_filter "Proc" do
|
|
69
63
|
fails "Proc.new with an associated block returns a new Proc instance from the block passed to the containing method"
|
70
64
|
fails "Proc.new with an associated block returns a subclass of Proc"
|
71
65
|
fails "Proc.new without a block uses the implicit block from an enclosing method"
|
66
|
+
fails "Proc#parameters returns an empty Array for a proc expecting no parameters"
|
67
|
+
fails "Proc#parameters returns an Array of Arrays for a proc expecting parameters"
|
68
|
+
fails "Proc#parameters sets the first element of each sub-Array to :opt for optional arguments"
|
69
|
+
fails "Proc#parameters regards named parameters in procs as optional"
|
70
|
+
fails "Proc#parameters regards optional keyword parameters in procs as optional"
|
71
|
+
fails "Proc#parameters regards parameters with default values as optional"
|
72
|
+
fails "Proc#parameters sets the first element of each sub-Array to :req for required arguments"
|
73
|
+
fails "Proc#parameters regards named parameters in lambdas as required"
|
74
|
+
fails "Proc#parameters regards keyword parameters in lambdas as required"
|
75
|
+
fails "Proc#parameters sets the first element of each sub-Array to :rest for parameters prefixed with asterisks"
|
76
|
+
fails "Proc#parameters sets the first element of each sub-Array to :keyrest for parameters prefixed with double asterisks"
|
77
|
+
fails "Proc#parameters sets the first element of each sub-Array to :block for parameters prefixed with ampersands"
|
78
|
+
fails "Proc#parameters sets the second element of each sub-Array to the name of the argument"
|
79
|
+
fails "Proc#parameters ignores unnamed rest args"
|
80
|
+
fails "Proc#parameters adds nameless rest arg for \"star\" argument"
|
81
|
+
fails "Proc#parameters does not add locals as block options with a block and splat"
|
72
82
|
end
|
data/spec/filters/bugs/range.rb
CHANGED
@@ -44,7 +44,6 @@ opal_filter "Range" do
|
|
44
44
|
fails "Range#first returns an empty array when passed zero"
|
45
45
|
fails "Range#first returns the specified number of elements from the beginning"
|
46
46
|
fails "Range#first truncates the value when passed a Float"
|
47
|
-
fails "Range#hash generates a Fixnum for the hash value"
|
48
47
|
fails "Range#hash generates the same hash values for Ranges with the same start, end and exclude_end? values"
|
49
48
|
fails "Range#include? compares values using <=>"
|
50
49
|
fails "Range#include? on string elements returns false if other is not matched by element.succ"
|
@@ -55,7 +54,6 @@ opal_filter "Range" do
|
|
55
54
|
fails "Range#include? with weird succ when included end value returns false if other is not matched by element.succ"
|
56
55
|
fails "Range#initialize is private"
|
57
56
|
fails "Range#initialize raises a NameError if called on an already initialized Range"
|
58
|
-
fails "Range#inspect ignores own untrusted status"
|
59
57
|
fails "Range#inspect returns a tainted string if either end is tainted"
|
60
58
|
fails "Range#inspect returns a untrusted string if either end is untrusted"
|
61
59
|
fails "Range#last calls #to_int to convert the argument"
|
@@ -140,7 +138,6 @@ opal_filter "Range" do
|
|
140
138
|
fails "Range#step with inclusive end and String values raises a TypeError when passed a Float step"
|
141
139
|
fails "Range#step with inclusive end and String values yields String values incremented by #succ and less than or equal to end when not passed a step"
|
142
140
|
fails "Range#step with inclusive end and String values yields String values incremented by #succ called Integer step times"
|
143
|
-
fails "Range#to_s ignores own untrusted status"
|
144
141
|
fails "Range#to_s provides a printable form of self"
|
145
142
|
fails "Range#to_s returns a tainted string if either end is tainted"
|
146
143
|
fails "Range#to_s returns a untrusted string if either end is untrusted"
|
data/spec/filters/bugs/regexp.rb
CHANGED
@@ -1,4 +1,24 @@
|
|
1
1
|
opal_filter "regular_expressions" do
|
2
|
+
fails "Regexp#encoding defaults to US-ASCII if the Regexp contains only US-ASCII character"
|
3
|
+
fails "Regexp#encoding defaults to UTF-8 if \\u escapes appear"
|
4
|
+
fails "Regexp#encoding defaults to UTF-8 if a literal UTF-8 character appears"
|
5
|
+
fails "Regexp#encoding ignores the default_internal encoding"
|
6
|
+
fails "Regexp#encoding ignores the encoding and uses US-ASCII if the string has only ASCII characters"
|
7
|
+
fails "Regexp#encoding returns ASCII-8BIT if the 'n' modifier is supplied and non-US-ASCII characters are present"
|
8
|
+
fails "Regexp#encoding returns EUC_JP if the 'e' modifier is supplied"
|
9
|
+
fails "Regexp#encoding returns US_ASCII if the 'n' modifier is supplied and only US-ASCII characters are present"
|
10
|
+
fails "Regexp#encoding returns UTF-8 if the 'u' modifier is supplied"
|
11
|
+
fails "Regexp#encoding returns Windows-31J if the 's' modifier is supplied"
|
12
|
+
fails "Regexp#encoding returns an Encoding object"
|
13
|
+
fails "Regexp#encoding upgrades the encoding to that of an embedded String"
|
14
|
+
fails "Regexp#fixed_encoding? returns false by default"
|
15
|
+
fails "Regexp#fixed_encoding? returns false if the 'n' modifier was supplied to the Regexp"
|
16
|
+
fails "Regexp#fixed_encoding? returns true if the 'e' modifier was supplied to the Regexp"
|
17
|
+
fails "Regexp#fixed_encoding? returns true if the 's' modifier was supplied to the Regexp"
|
18
|
+
fails "Regexp#fixed_encoding? returns true if the 'u' modifier was supplied to the Regexp"
|
19
|
+
fails "Regexp#fixed_encoding? returns true if the Regexp contains a UTF-8 literal"
|
20
|
+
fails "Regexp#fixed_encoding? returns true if the Regexp contains a \\u escape"
|
21
|
+
fails "Regexp#fixed_encoding? returns true if the Regexp was created with the Regexp::FIXEDENCODING option"
|
2
22
|
fails "Regexp#hash is based on the text and options of Regexp"
|
3
23
|
fails "Regexp#hash returns the same value for two Regexps differing only in the /n option"
|
4
24
|
fails "Regexp#initialize is a private method"
|
@@ -10,6 +30,18 @@ opal_filter "regular_expressions" do
|
|
10
30
|
fails "Regexp#inspect does not over escape"
|
11
31
|
fails "Regexp#inspect escapes 2 slashes in a row properly"
|
12
32
|
fails "Regexp#inspect returns options in the order 'mixn'"
|
33
|
+
fails "Regexp#named_captures returns a Hash"
|
34
|
+
fails "Regexp#named_captures returns an empty Hash when there are no capture groups"
|
35
|
+
fails "Regexp#named_captures sets each element of the Array to the corresponding group's index"
|
36
|
+
fails "Regexp#named_captures sets the keys of the Hash to the names of the capture groups"
|
37
|
+
fails "Regexp#named_captures sets the values of the Hash to Arrays"
|
38
|
+
fails "Regexp#named_captures works with duplicate capture group names"
|
39
|
+
fails "Regexp#names returns all of the named captures"
|
40
|
+
fails "Regexp#names returns an Array"
|
41
|
+
fails "Regexp#names returns an empty Array if there are no named captures"
|
42
|
+
fails "Regexp#names returns each capture name only once"
|
43
|
+
fails "Regexp#names returns each named capture as a String"
|
44
|
+
fails "Regexp#names works with nested named captures"
|
13
45
|
fails "Regexp#to_s deals properly with the two types of lookahead groups"
|
14
46
|
fails "Regexp#to_s returns a string in (?xxx:yyy) notation"
|
15
47
|
fails "Regexp#to_s shows all options as excluded if none are selected"
|
@@ -28,9 +60,8 @@ opal_filter "regular_expressions" do
|
|
28
60
|
fails "Regexp.compile given a String sets options from second argument if it is one of the Fixnum option constants"
|
29
61
|
fails "Regexp.compile given a String treats any non-Fixnum, non-nil, non-false second argument as IGNORECASE"
|
30
62
|
fails "Regexp.compile given a String uses ASCII_8BIT encoding if third argument is 'n' or 'none' (case insensitive) and non-ascii characters"
|
31
|
-
fails "Regexp.compile given a String uses the String argument as an unescaped literal to construct a Regexp object"
|
32
63
|
fails "Regexp.compile given a String uses US_ASCII encoding if third argument is 'n' or 'none' (case insensitive) and only ascii characters"
|
33
|
-
fails "Regexp.compile given a String
|
64
|
+
fails "Regexp.compile given a String uses the String argument as an unescaped literal to construct a Regexp object"
|
34
65
|
fails "Regexp.compile given a String with escaped characters accepts '\\C-\\a'"
|
35
66
|
fails "Regexp.compile given a String with escaped characters accepts '\\C-\\e'"
|
36
67
|
fails "Regexp.compile given a String with escaped characters accepts '\\C-\\f'"
|
@@ -38,16 +69,6 @@ opal_filter "regular_expressions" do
|
|
38
69
|
fails "Regexp.compile given a String with escaped characters accepts '\\C-\\r'"
|
39
70
|
fails "Regexp.compile given a String with escaped characters accepts '\\C-\\t'"
|
40
71
|
fails "Regexp.compile given a String with escaped characters accepts '\\C-\\v'"
|
41
|
-
fails "Regexp.compile given a String with escaped characters accepts '\\c\\a'"
|
42
|
-
fails "Regexp.compile given a String with escaped characters accepts '\\c\\e'"
|
43
|
-
fails "Regexp.compile given a String with escaped characters accepts '\\c\\f'"
|
44
|
-
fails "Regexp.compile given a String with escaped characters accepts '\\c\\n'"
|
45
|
-
fails "Regexp.compile given a String with escaped characters accepts '\\c\\r'"
|
46
|
-
fails "Regexp.compile given a String with escaped characters accepts '\\c\\t'"
|
47
|
-
fails "Regexp.compile given a String with escaped characters accepts '\\c\\v'"
|
48
|
-
fails "Regexp.compile given a String with escaped characters accepts '\\e'"
|
49
|
-
fails "Regexp.compile given a String with escaped characters accepts '\\f'"
|
50
|
-
fails "Regexp.compile given a String with escaped characters accepts '\\M-\\a'"
|
51
72
|
fails "Regexp.compile given a String with escaped characters accepts '\\M-\\C-\\a'"
|
52
73
|
fails "Regexp.compile given a String with escaped characters accepts '\\M-\\C-\\e'"
|
53
74
|
fails "Regexp.compile given a String with escaped characters accepts '\\M-\\C-\\f'"
|
@@ -55,6 +76,7 @@ opal_filter "regular_expressions" do
|
|
55
76
|
fails "Regexp.compile given a String with escaped characters accepts '\\M-\\C-\\r'"
|
56
77
|
fails "Regexp.compile given a String with escaped characters accepts '\\M-\\C-\\t'"
|
57
78
|
fails "Regexp.compile given a String with escaped characters accepts '\\M-\\C-\\v'"
|
79
|
+
fails "Regexp.compile given a String with escaped characters accepts '\\M-\\a'"
|
58
80
|
fails "Regexp.compile given a String with escaped characters accepts '\\M-\\c\\a'"
|
59
81
|
fails "Regexp.compile given a String with escaped characters accepts '\\M-\\c\\e'"
|
60
82
|
fails "Regexp.compile given a String with escaped characters accepts '\\M-\\c\\f'"
|
@@ -68,22 +90,32 @@ opal_filter "regular_expressions" do
|
|
68
90
|
fails "Regexp.compile given a String with escaped characters accepts '\\M-\\r'"
|
69
91
|
fails "Regexp.compile given a String with escaped characters accepts '\\M-\\t'"
|
70
92
|
fails "Regexp.compile given a String with escaped characters accepts '\\M-\\v'"
|
93
|
+
fails "Regexp.compile given a String with escaped characters accepts '\\a'"
|
94
|
+
fails "Regexp.compile given a String with escaped characters accepts '\\c\\a'"
|
95
|
+
fails "Regexp.compile given a String with escaped characters accepts '\\c\\e'"
|
96
|
+
fails "Regexp.compile given a String with escaped characters accepts '\\c\\f'"
|
97
|
+
fails "Regexp.compile given a String with escaped characters accepts '\\c\\n'"
|
98
|
+
fails "Regexp.compile given a String with escaped characters accepts '\\c\\r'"
|
99
|
+
fails "Regexp.compile given a String with escaped characters accepts '\\c\\t'"
|
100
|
+
fails "Regexp.compile given a String with escaped characters accepts '\\c\\v'"
|
101
|
+
fails "Regexp.compile given a String with escaped characters accepts '\\e'"
|
102
|
+
fails "Regexp.compile given a String with escaped characters accepts '\\f'"
|
71
103
|
fails "Regexp.compile given a String with escaped characters accepts '\\n'"
|
72
104
|
fails "Regexp.compile given a String with escaped characters accepts '\\r'"
|
73
105
|
fails "Regexp.compile given a String with escaped characters accepts '\\t'"
|
74
106
|
fails "Regexp.compile given a String with escaped characters accepts '\\v'"
|
75
|
-
fails "Regexp.compile given a String with escaped characters accepts \\u{H} for a single Unicode codepoint"
|
76
|
-
fails "Regexp.compile given a String with escaped characters accepts \\u{HH} for a single Unicode codepoint"
|
77
|
-
fails "Regexp.compile given a String with escaped characters accepts \\u{HHH} for a single Unicode codepoint"
|
78
|
-
fails "Regexp.compile given a String with escaped characters accepts \\u{HHHH} followed by characters"
|
79
|
-
fails "Regexp.compile given a String with escaped characters accepts \\u{HHHH} for a single Unicode codepoint"
|
80
|
-
fails "Regexp.compile given a String with escaped characters accepts \\u{HHHHH} for a single Unicode codepoint"
|
81
|
-
fails "Regexp.compile given a String with escaped characters accepts \\u{HHHHHH} for a single Unicode codepoint"
|
82
107
|
fails "Regexp.compile given a String with escaped characters accepts \\uHHHH followed by characters"
|
83
108
|
fails "Regexp.compile given a String with escaped characters accepts \\uHHHH for a single Unicode codepoint"
|
109
|
+
fails "Regexp.compile given a String with escaped characters accepts \\u{HHHHHH} for a single Unicode codepoint"
|
110
|
+
fails "Regexp.compile given a String with escaped characters accepts \\u{HHHHH} for a single Unicode codepoint"
|
111
|
+
fails "Regexp.compile given a String with escaped characters accepts \\u{HHHH} followed by characters"
|
112
|
+
fails "Regexp.compile given a String with escaped characters accepts \\u{HHHH} for a single Unicode codepoint"
|
113
|
+
fails "Regexp.compile given a String with escaped characters accepts \\u{HHH} for a single Unicode codepoint"
|
114
|
+
fails "Regexp.compile given a String with escaped characters accepts \\u{HH} for a single Unicode codepoint"
|
115
|
+
fails "Regexp.compile given a String with escaped characters accepts \\u{H} for a single Unicode codepoint"
|
84
116
|
fails "Regexp.compile given a String with escaped characters accepts a backspace followed by a character"
|
85
|
-
fails "Regexp.compile given a String with escaped characters accepts a combination of escaped octal and hexadecimal digits and \\u{HHHH}"
|
86
117
|
fails "Regexp.compile given a String with escaped characters accepts a combination of escaped octal and hexadecimal digits and \\uHHHH"
|
118
|
+
fails "Regexp.compile given a String with escaped characters accepts a combination of escaped octal and hexadecimal digits and \\u{HHHH}"
|
87
119
|
fails "Regexp.compile given a String with escaped characters accepts a one-digit hexadecimal value"
|
88
120
|
fails "Regexp.compile given a String with escaped characters accepts a one-digit octal value"
|
89
121
|
fails "Regexp.compile given a String with escaped characters accepts a three-digit octal value"
|
@@ -92,15 +124,15 @@ opal_filter "regular_expressions" do
|
|
92
124
|
fails "Regexp.compile given a String with escaped characters accepts an escaped string interpolation"
|
93
125
|
fails "Regexp.compile given a String with escaped characters accepts characters and escaped hexadecimal digits"
|
94
126
|
fails "Regexp.compile given a String with escaped characters accepts characters and escaped octal digits"
|
95
|
-
fails "Regexp.compile given a String with escaped characters accepts characters followed by \\u{HHHH}"
|
96
127
|
fails "Regexp.compile given a String with escaped characters accepts characters followed by \\uHHHH"
|
128
|
+
fails "Regexp.compile given a String with escaped characters accepts characters followed by \\u{HHHH}"
|
97
129
|
fails "Regexp.compile given a String with escaped characters accepts escaped hexadecimal and octal digits"
|
98
130
|
fails "Regexp.compile given a String with escaped characters accepts escaped hexadecimal digits and characters"
|
99
|
-
fails "Regexp.compile given a String with escaped characters accepts escaped hexadecimal digits followed by \\u{HHHH}"
|
100
131
|
fails "Regexp.compile given a String with escaped characters accepts escaped hexadecimal digits followed by \\uHHHH"
|
132
|
+
fails "Regexp.compile given a String with escaped characters accepts escaped hexadecimal digits followed by \\u{HHHH}"
|
101
133
|
fails "Regexp.compile given a String with escaped characters accepts escaped octal digits and characters"
|
102
|
-
fails "Regexp.compile given a String with escaped characters accepts escaped octal digits followed by \\u{HHHH}"
|
103
134
|
fails "Regexp.compile given a String with escaped characters accepts escaped octal digits followed by \\uHHHH"
|
135
|
+
fails "Regexp.compile given a String with escaped characters accepts escaped octal digits followed by \\u{HHHH}"
|
104
136
|
fails "Regexp.compile given a String with escaped characters accepts multiple consecutive '\\' characters"
|
105
137
|
fails "Regexp.compile given a String with escaped characters interprets a digit following a three-digit octal value as a character"
|
106
138
|
fails "Regexp.compile given a String with escaped characters interprets a digit following a two-digit hexadecimal value as a character"
|
@@ -109,14 +141,14 @@ opal_filter "regular_expressions" do
|
|
109
141
|
fails "Regexp.compile given a String with escaped characters raises a RegexpError if less than four digits are given for \\uHHHH"
|
110
142
|
fails "Regexp.compile given a String with escaped characters raises a RegexpError if more than six hexadecimal digits are given"
|
111
143
|
fails "Regexp.compile given a String with escaped characters raises a RegexpError if the \\u{} escape is empty"
|
112
|
-
fails "Regexp.compile given a String with escaped characters returns a Regexp with
|
113
|
-
fails "Regexp.compile given a String with escaped characters returns a Regexp with
|
144
|
+
fails "Regexp.compile given a String with escaped characters returns a Regexp with US-ASCII encoding if UTF-8 escape sequences using only 7-bit ASCII are present"
|
145
|
+
fails "Regexp.compile given a String with escaped characters returns a Regexp with US-ASCII encoding if only 7-bit ASCII characters are present regardless of the input String's encoding"
|
146
|
+
fails "Regexp.compile given a String with escaped characters returns a Regexp with UTF-8 encoding if any UTF-8 escape sequences outside 7-bit ASCII are present"
|
114
147
|
fails "Regexp.compile given a String with escaped characters returns a Regexp with source String having US-ASCII encoding if UTF-8 escape sequences using only 7-bit ASCII are present"
|
148
|
+
fails "Regexp.compile given a String with escaped characters returns a Regexp with source String having US-ASCII encoding if only 7-bit ASCII characters are present regardless of the input String's encoding"
|
115
149
|
fails "Regexp.compile given a String with escaped characters returns a Regexp with source String having UTF-8 encoding if any UTF-8 escape sequences outside 7-bit ASCII are present"
|
150
|
+
fails "Regexp.compile given a String with escaped characters returns a Regexp with source String having the input String's encoding"
|
116
151
|
fails "Regexp.compile given a String with escaped characters returns a Regexp with the input String's encoding"
|
117
|
-
fails "Regexp.compile given a String with escaped characters returns a Regexp with US-ASCII encoding if only 7-bit ASCII characters are present regardless of the input String's encoding"
|
118
|
-
fails "Regexp.compile given a String with escaped characters returns a Regexp with US-ASCII encoding if UTF-8 escape sequences using only 7-bit ASCII are present"
|
119
|
-
fails "Regexp.compile given a String with escaped characters returns a Regexp with UTF-8 encoding if any UTF-8 escape sequences outside 7-bit ASCII are present"
|
120
152
|
fails "Regexp.compile requires one argument and creates a new regular expression object"
|
121
153
|
fails "Regexp.compile works by default for subclasses with overridden #initialize"
|
122
154
|
fails "Regexp.new given a String raises a RegexpError when passed an incorrect regexp"
|
@@ -127,14 +159,6 @@ opal_filter "regular_expressions" do
|
|
127
159
|
fails "Regexp.new given a String with escaped characters accepts '\\C-\\r'"
|
128
160
|
fails "Regexp.new given a String with escaped characters accepts '\\C-\\t'"
|
129
161
|
fails "Regexp.new given a String with escaped characters accepts '\\C-\\v'"
|
130
|
-
fails "Regexp.new given a String with escaped characters accepts '\\c\\a'"
|
131
|
-
fails "Regexp.new given a String with escaped characters accepts '\\c\\e'"
|
132
|
-
fails "Regexp.new given a String with escaped characters accepts '\\c\\f'"
|
133
|
-
fails "Regexp.new given a String with escaped characters accepts '\\c\\n'"
|
134
|
-
fails "Regexp.new given a String with escaped characters accepts '\\c\\r'"
|
135
|
-
fails "Regexp.new given a String with escaped characters accepts '\\c\\t'"
|
136
|
-
fails "Regexp.new given a String with escaped characters accepts '\\c\\v'"
|
137
|
-
fails "Regexp.new given a String with escaped characters accepts '\\M-\\a'"
|
138
162
|
fails "Regexp.new given a String with escaped characters accepts '\\M-\\C-\\a'"
|
139
163
|
fails "Regexp.new given a String with escaped characters accepts '\\M-\\C-\\e'"
|
140
164
|
fails "Regexp.new given a String with escaped characters accepts '\\M-\\C-\\f'"
|
@@ -142,6 +166,7 @@ opal_filter "regular_expressions" do
|
|
142
166
|
fails "Regexp.new given a String with escaped characters accepts '\\M-\\C-\\r'"
|
143
167
|
fails "Regexp.new given a String with escaped characters accepts '\\M-\\C-\\t'"
|
144
168
|
fails "Regexp.new given a String with escaped characters accepts '\\M-\\C-\\v'"
|
169
|
+
fails "Regexp.new given a String with escaped characters accepts '\\M-\\a'"
|
145
170
|
fails "Regexp.new given a String with escaped characters accepts '\\M-\\c\\a'"
|
146
171
|
fails "Regexp.new given a String with escaped characters accepts '\\M-\\c\\e'"
|
147
172
|
fails "Regexp.new given a String with escaped characters accepts '\\M-\\c\\f'"
|
@@ -155,6 +180,13 @@ opal_filter "regular_expressions" do
|
|
155
180
|
fails "Regexp.new given a String with escaped characters accepts '\\M-\\r'"
|
156
181
|
fails "Regexp.new given a String with escaped characters accepts '\\M-\\t'"
|
157
182
|
fails "Regexp.new given a String with escaped characters accepts '\\M-\\v'"
|
183
|
+
fails "Regexp.new given a String with escaped characters accepts '\\c\\a'"
|
184
|
+
fails "Regexp.new given a String with escaped characters accepts '\\c\\e'"
|
185
|
+
fails "Regexp.new given a String with escaped characters accepts '\\c\\f'"
|
186
|
+
fails "Regexp.new given a String with escaped characters accepts '\\c\\n'"
|
187
|
+
fails "Regexp.new given a String with escaped characters accepts '\\c\\r'"
|
188
|
+
fails "Regexp.new given a String with escaped characters accepts '\\c\\t'"
|
189
|
+
fails "Regexp.new given a String with escaped characters accepts '\\c\\v'"
|
158
190
|
fails "Regexp.new given a String with escaped characters raises a RegexpError if \\x is not followed by any hexadecimal digits"
|
159
191
|
fails "Regexp.new given a String with escaped characters raises a RegexpError if more than six hexadecimal digits are given"
|
160
192
|
fails "Regexp.new works by default for subclasses with overridden #initialize"
|