opal 0.9.0.beta2 → 0.9.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.jshintrc +2 -1
- data/.travis.yml +8 -4
- data/CHANGELOG.md +270 -251
- data/CONTRIBUTING.md +41 -0
- data/README.md +8 -8
- data/Rakefile +1 -1
- data/lib/opal/cli.rb +1 -0
- data/lib/opal/cli_options.rb +2 -2
- data/lib/opal/cli_runners.rb +1 -0
- data/lib/opal/cli_runners/nashorn.rb +58 -0
- data/lib/opal/cli_runners/phantom.js +11 -9
- data/lib/opal/compiler.rb +2 -0
- data/lib/opal/erb.rb +2 -1
- data/lib/opal/nodes/def.rb +15 -6
- data/lib/opal/nodes/helpers.rb +1 -1
- data/lib/opal/nodes/literal.rb +1 -1
- data/lib/opal/nodes/masgn.rb +79 -29
- data/lib/opal/nodes/module.rb +1 -1
- data/lib/opal/nodes/top.rb +6 -2
- data/lib/opal/parser.rb +1 -0
- data/lib/opal/parser/grammar.rb +3160 -3083
- data/lib/opal/parser/grammar.y +39 -11
- data/lib/opal/parser/lexer.rb +15 -13
- data/lib/opal/parser/sexp.rb +5 -0
- data/lib/opal/version.rb +1 -1
- data/opal/corelib/array.rb +21 -6
- data/opal/corelib/basic_object.rb +17 -4
- data/opal/corelib/class.rb +1 -1
- data/opal/corelib/constants.rb +2 -2
- data/opal/corelib/enumerator.rb +2 -0
- data/opal/corelib/hash.rb +50 -50
- data/opal/corelib/helpers.rb +1 -1
- data/opal/corelib/io.rb +9 -6
- data/opal/corelib/kernel.rb +37 -9
- data/opal/corelib/module.rb +6 -17
- data/opal/corelib/nil.rb +4 -0
- data/opal/corelib/number.rb +0 -4
- data/opal/corelib/runtime.js +637 -662
- data/opal/corelib/struct.rb +7 -3
- data/spec/filters/bugs/array.rb +4 -9
- data/spec/filters/bugs/basicobject.rb +1 -15
- data/spec/filters/bugs/date.rb +4 -26
- data/spec/filters/bugs/enumerable.rb +26 -1
- data/spec/filters/bugs/enumerator.rb +4 -4
- data/spec/filters/bugs/exception.rb +1 -7
- data/spec/filters/bugs/float.rb +14 -0
- data/spec/filters/bugs/hash.rb +0 -2
- data/spec/filters/bugs/integer.rb +1 -1
- data/spec/filters/bugs/kernel.rb +47 -66
- data/spec/filters/bugs/language.rb +1 -2
- data/spec/filters/bugs/module.rb +11 -14
- data/spec/filters/bugs/numeric.rb +3 -3
- data/spec/filters/bugs/proc.rb +0 -1
- data/spec/filters/bugs/range.rb +2 -3
- data/spec/filters/bugs/regexp.rb +15 -17
- data/spec/filters/bugs/set.rb +2 -2
- data/spec/filters/bugs/string.rb +29 -5
- data/spec/filters/bugs/{strscan.rb → stringscanner.rb} +9 -10
- data/spec/filters/bugs/struct.rb +0 -4
- data/spec/filters/bugs/time.rb +2 -3
- data/spec/filters/bugs/unboundmethod.rb +3 -0
- data/spec/filters/unsupported/freeze.rb +2 -1
- data/spec/filters/unsupported/taint.rb +2 -0
- data/spec/lib/parser/aref_spec.rb +10 -0
- data/spec/lib/parser/lambda_spec.rb +14 -0
- data/spec/lib/parser/op_asgn_spec.rb +17 -0
- data/spec/lib/parser/return_spec.rb +5 -0
- data/spec/lib/parser/unary_spec.rb +4 -0
- data/spec/lib/sprockets/erb_spec.rb +1 -1
- data/spec/mspec/opal/formatters.rb +159 -0
- data/{lib → spec}/mspec/opal/runner.rb +0 -160
- data/spec/opal/core/hash/internals_spec.rb +162 -162
- data/spec/opal/core/kernel/at_exit_spec.rb +70 -0
- data/spec/opal/core/kernel/extend_spec.rb +1 -1
- data/spec/opal/core/kernel/instance_variables_spec.rb +56 -0
- data/spec/opal/core/language/equal_spec.rb +8 -0
- data/spec/opal/core/language/predefined_spec.rb +1 -1
- data/spec/opal/core/language/ternary_operator_spec.rb +14 -0
- data/spec/opal/core/language/versions/{hash_1.9.rb → hash_1_9_spec.rb} +5 -0
- data/spec/opal/core/module/fixtures/classes.rb +11 -1
- data/spec/opal/core/module/method_lookup_spec.rb +13 -0
- data/spec/opal/core/runtime/super_spec.rb +10 -0
- data/spec/opal/stdlib/native/new_spec.rb +84 -0
- data/spec/opal/stdlib/strscan/scan_spec.rb +11 -0
- data/spec/rubyspecs +6 -9
- data/spec/spec_helper.rb +9 -21
- data/stdlib/date.rb +121 -1
- data/stdlib/js.rb +13 -5
- data/stdlib/json.rb +3 -3
- data/stdlib/nashorn.rb +5 -0
- data/stdlib/nashorn/file.rb +13 -0
- data/stdlib/nashorn/io.rb +2 -0
- data/stdlib/native.rb +12 -4
- data/stdlib/nodejs/io.rb +5 -2
- data/stdlib/opal/platform.rb +19 -0
- data/stdlib/phantomjs.rb +4 -0
- data/stdlib/strscan.rb +1 -1
- data/tasks/building.rake +2 -1
- data/tasks/testing.rake +29 -34
- data/tasks/testing/{phantomjs1-sprockets.js → sprockets-phantomjs.js} +2 -20
- data/vendored-minitest/minitest/test.rb +7 -15
- metadata +32 -9
- data/lib/mspec/opal/main.rb.erb +0 -9
@@ -53,7 +53,6 @@ opal_filter "language" do
|
|
53
53
|
fails "A singleton class raises a TypeError for Fixnum's"
|
54
54
|
fails "A singleton class raises a TypeError for symbols"
|
55
55
|
fails "An ensure block inside a begin block is executed even when a symbol is thrown in it's corresponding begin block"
|
56
|
-
fails "An ensure block inside a method is executed even when a symbol is thrown in the method"
|
57
56
|
fails "Assigning an anonymous module to a constant sets the name of contained modules when assigning a toplevel anonymous module"
|
58
57
|
fails "Assigning an anonymous module to a constant sets the name of the module"
|
59
58
|
fails "calling methods on the metaclass calls a method defined on the metaclass of the metaclass"
|
@@ -152,8 +151,8 @@ opal_filter "language" do
|
|
152
151
|
fails "The super keyword raises an error error when super method does not exist"
|
153
152
|
fails "The super keyword uses given block even if arguments are passed explicitly"
|
154
153
|
fails "The super keyword without explicit arguments passes arguments and rest arguments including any modifications"
|
155
|
-
fails "The super keyword without explicit arguments passes optional arguments that have a default value but were modified"
|
156
154
|
fails "The super keyword without explicit arguments passes optional arguments that have a default value"
|
155
|
+
fails "The super keyword without explicit arguments passes optional arguments that have a default value but were modified"
|
157
156
|
fails "The super keyword without explicit arguments passes optional arguments that have a non-default value but were modified"
|
158
157
|
fails "The super keyword without explicit arguments passes rest arguments including any modifications"
|
159
158
|
fails "The unpacking splat operator (*) unpacks arguments as if they were listed statically"
|
data/spec/filters/bugs/module.rb
CHANGED
@@ -5,8 +5,8 @@ opal_filter "Module" do
|
|
5
5
|
fails "Module#<= raises a TypeError if the argument is not a class/module"
|
6
6
|
fails "Module#<= returns nil if self is not related to the given module"
|
7
7
|
fails "Module#<= returns true if self is a subclass of, the same as or includes the given module"
|
8
|
-
fails "Module#<=> returns -1 if self is a subclass of or includes the given module"
|
9
8
|
fails "Module#<=> returns +1 if self is a superclas of or included by the given module"
|
9
|
+
fails "Module#<=> returns -1 if self is a subclass of or includes the given module"
|
10
10
|
fails "Module#=== returns true when the given Object's class includes self or when the given Object is extended by self"
|
11
11
|
fails "Module#> raises a TypeError if the argument is not a class/module"
|
12
12
|
fails "Module#> returns false if self is a subclass of or includes the given module"
|
@@ -17,9 +17,7 @@ opal_filter "Module" do
|
|
17
17
|
fails "Module#>= returns false if self is a subclass of or includes the given module"
|
18
18
|
fails "Module#>= returns nil if self is not related to the given module"
|
19
19
|
fails "Module#>= returns true if self is a superclass of, the same as or included by given module"
|
20
|
-
fails "Module#alias_method accesses a method defined on Object from Kernel"
|
21
20
|
fails "Module#alias_method can call a method with super aliased twice"
|
22
|
-
fails "Module#alias_method fails if origin method not found"
|
23
21
|
fails "Module#alias_method preserves the arguments information of the original methods"
|
24
22
|
fails "Module#alias_method raises a TypeError when the given name can't be converted using to_str"
|
25
23
|
fails "Module#alias_method retains method visibility"
|
@@ -34,23 +32,24 @@ opal_filter "Module" do
|
|
34
32
|
fails "Module#attr creates a getter but no setter for all given attribute names"
|
35
33
|
fails "Module#attr creates a getter for the given attribute name"
|
36
34
|
fails "Module#attr raises a TypeError when the given names can't be converted to strings using to_str"
|
37
|
-
fails "Module#attr_accessor allows creating an attr_accessor on an immediate class"
|
38
35
|
fails "Module#attr_accessor applies current visibility to methods created"
|
39
36
|
fails "Module#attr_accessor converts non string/symbol/fixnum names to strings using to_str"
|
37
|
+
fails "Module#attr_accessor not allows creating an attr_accessor on an immediate class"
|
40
38
|
fails "Module#attr_accessor raises a TypeError when the given names can't be converted to strings using to_str"
|
41
|
-
fails "Module#attr_reader allows for adding an attr_reader to an immediate"
|
42
39
|
fails "Module#attr_reader applies current visibility to methods created"
|
43
40
|
fails "Module#attr_reader converts non string/symbol/fixnum names to strings using to_str"
|
41
|
+
fails "Module#attr_reader not allows for adding an attr_reader to an immediate"
|
44
42
|
fails "Module#attr_reader raises a TypeError when the given names can't be converted to strings using to_str"
|
45
|
-
fails "Module#attr_writer allows for adding an attr_writer to an immediate"
|
46
43
|
fails "Module#attr_writer applies current visibility to methods created"
|
47
44
|
fails "Module#attr_writer converts non string/symbol/fixnum names to strings using to_str"
|
45
|
+
fails "Module#attr_writer not allows for adding an attr_writer to an immediate"
|
48
46
|
fails "Module#attr_writer raises a TypeError when the given names can't be converted to strings using to_str"
|
49
47
|
fails "Module#class_eval adds methods respecting the lexical constant scope"
|
50
48
|
fails "Module#class_eval converts a non-string filename to a string using to_str"
|
51
49
|
fails "Module#class_eval converts non string eval-string to string using to_str"
|
52
50
|
fails "Module#class_eval defines constants in the receiver's scope"
|
53
51
|
fails "Module#class_eval evaluates a given string in the context of self"
|
52
|
+
fails "Module#class_eval passes the module as the first argument of the block"
|
54
53
|
fails "Module#class_eval raises a TypeError when the given eval-string can't be converted to string using to_str"
|
55
54
|
fails "Module#class_eval raises a TypeError when the given filename can't be converted to string using to_str"
|
56
55
|
fails "Module#class_eval resolves constants in the caller scope ignoring send"
|
@@ -77,7 +76,6 @@ opal_filter "Module" do
|
|
77
76
|
fails "Module#const_get does not search the singleton class of a Class or Module"
|
78
77
|
fails "Module#const_get raises a NameError if a Symbol is a scoped constant name"
|
79
78
|
fails "Module#const_get raises a NameError if the constant is defined in the receiver's supperclass and the inherit flag is false"
|
80
|
-
fails "Module#const_get raises a NameError with the not found constant symbol"
|
81
79
|
fails "Module#const_get raises a TypeError if conversion to a String by calling #to_str fails"
|
82
80
|
fails "Module#const_get with dynamically assigned constants searches a module included in the immediate class before the superclass"
|
83
81
|
fails "Module#const_get with dynamically assigned constants searches a module included in the superclass"
|
@@ -93,8 +91,6 @@ opal_filter "Module" do
|
|
93
91
|
fails "Module#define_method does not change the arity check style of the original proc"
|
94
92
|
fails "Module#define_method passed { } creates a method that raises an ArgumentError when passed one argument"
|
95
93
|
fails "Module#define_method passed { } creates a method that raises an ArgumentError when passed two arguments"
|
96
|
-
fails "Module#define_method passed { || } creates a method that raises an ArgumentError when passed one argument"
|
97
|
-
fails "Module#define_method passed { || } creates a method that raises an ArgumentError when passed two arguments"
|
98
94
|
fails "Module#define_method passed { |a, *b| } creates a method that raises an ArgumentError when passed zero arguments"
|
99
95
|
fails "Module#define_method passed { |a, b, *c| } creates a method that raises an ArgumentError when passed one argument and a block"
|
100
96
|
fails "Module#define_method passed { |a, b, *c| } creates a method that raises an ArgumentError when passed one argument"
|
@@ -106,6 +102,8 @@ opal_filter "Module" do
|
|
106
102
|
fails "Module#define_method passed { |a| } creates a method that raises an ArgumentError when passed two arguments"
|
107
103
|
fails "Module#define_method passed { |a| } creates a method that raises an ArgumentError when passed zero arguments and a block"
|
108
104
|
fails "Module#define_method passed { |a| } creates a method that raises an ArgumentError when passed zero arguments"
|
105
|
+
fails "Module#define_method passed { || } creates a method that raises an ArgumentError when passed one argument"
|
106
|
+
fails "Module#define_method passed { || } creates a method that raises an ArgumentError when passed two arguments"
|
109
107
|
fails "Module#define_method raises a TypeError when a Method from a singleton class is defined on another class"
|
110
108
|
fails "Module#define_method raises a TypeError when a Method from one class is defined on an unrelated class"
|
111
109
|
fails "Module#define_method raises a TypeError when an UnboundMethod from a child class is defined on a parent class"
|
@@ -115,13 +113,11 @@ opal_filter "Module" do
|
|
115
113
|
fails "Module#extend_object extends the given object with its constants and methods by default"
|
116
114
|
fails "Module#extend_object is called when #extend is called on an object"
|
117
115
|
fails "Module#extend_object on Class raises a TypeError if calling after rebinded to Class"
|
118
|
-
fails "Module#include adds all ancestor modules when a previously included module is included again"
|
119
116
|
fails "Module#include detects cyclic includes"
|
120
117
|
fails "Module#include does not override existing constants in modules and classes"
|
121
118
|
fails "Module#include doesn't include module if it is included in a super class"
|
122
119
|
fails "Module#include ignores modules it has already included via module mutual inclusion"
|
123
120
|
fails "Module#include preserves ancestor order"
|
124
|
-
fails "Module#include raises a TypeError when the argument is not a Module"
|
125
121
|
fails "Module#include recursively includes new mixins"
|
126
122
|
fails "Module#include? raises a TypeError when no module was given"
|
127
123
|
fails "Module#include? returns true if the given module is included by self or one of it's ancestors"
|
@@ -131,7 +127,6 @@ opal_filter "Module" do
|
|
131
127
|
fails "Module#instance_method raises a NameError if the method has been undefined"
|
132
128
|
fails "Module#instance_method raises a TypeError if not passed a symbol"
|
133
129
|
fails "Module#instance_method raises a TypeError if the given name is not a string/symbol"
|
134
|
-
fails "Module#instance_method sets the NameError#name attribute to the name of the missing method"
|
135
130
|
fails "Module#method_defined? converts the given name to a string using to_str"
|
136
131
|
fails "Module#method_defined? raises a TypeError when the given object is not a string/symbol/fixnum"
|
137
132
|
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"
|
@@ -140,6 +135,7 @@ opal_filter "Module" do
|
|
140
135
|
fails "Module#module_eval converts non string eval-string to string using to_str"
|
141
136
|
fails "Module#module_eval defines constants in the receiver's scope"
|
142
137
|
fails "Module#module_eval evaluates a given string in the context of self"
|
138
|
+
fails "Module#module_eval passes the module as the first argument of the block"
|
143
139
|
fails "Module#module_eval raises a TypeError when the given eval-string can't be converted to string using to_str"
|
144
140
|
fails "Module#module_eval raises a TypeError when the given filename can't be converted to string using to_str"
|
145
141
|
fails "Module#module_eval resolves constants in the caller scope ignoring send"
|
@@ -147,7 +143,6 @@ opal_filter "Module" do
|
|
147
143
|
fails "Module#module_eval resolves constants in the receiver's scope"
|
148
144
|
fails "Module#module_eval uses the optional filename and lineno parameters for error messages"
|
149
145
|
fails "Module#module_exec defines method in the receiver's scope"
|
150
|
-
fails "Module#module_function as a toggle (no arguments) in a Module body affects evaled method definitions also even when outside the eval itself"
|
151
146
|
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"
|
152
147
|
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"
|
153
148
|
fails "Module#module_function as a toggle (no arguments) in a Module body functions normally if both toggle and definitions inside a eval"
|
@@ -165,6 +160,7 @@ opal_filter "Module" do
|
|
165
160
|
fails "Module#prepend clears any caches"
|
166
161
|
fails "Module#prepend depends on prepend_features to add the module"
|
167
162
|
fails "Module#prepend detects cyclic prepends"
|
163
|
+
fails "Module#prepend does not affect the superclass"
|
168
164
|
fails "Module#prepend does not import constants"
|
169
165
|
fails "Module#prepend does not import methods to modules and classes"
|
170
166
|
fails "Module#prepend imports instance methods"
|
@@ -183,6 +179,7 @@ opal_filter "Module" do
|
|
183
179
|
fails "Module#prepend supports super when the module is prepended into a singleton class"
|
184
180
|
fails "Module#prepend throws a NoMethodError when there is no more superclass"
|
185
181
|
fails "Module#prepend works with subclasses"
|
182
|
+
fails "Module#prepend_features clears caches of the given module"
|
186
183
|
fails "Module#prepend_features copies own tainted status to the given module"
|
187
184
|
fails "Module#prepend_features copies own untrusted status to the given module"
|
188
185
|
fails "Module#prepend_features gets called when self is included in another module/class"
|
@@ -204,8 +201,8 @@ opal_filter "Module" do
|
|
204
201
|
fails "Module#remove_const raises a NameError if the name does not start with a capital letter"
|
205
202
|
fails "Module#remove_const raises a NameError if the name starts with a non-alphabetic character"
|
206
203
|
fails "Module#remove_const raises a TypeError if conversion to a String by calling #to_str fails"
|
204
|
+
fails "Module#remove_const returns nil when removing autoloaded constant"
|
207
205
|
fails "Module.allocate returns a fully-formed instance of Module"
|
208
|
-
fails "Module.constants returns an array of Symbol names"
|
209
206
|
fails "Module.constants returns Module's constants when given a parameter"
|
210
207
|
fails "Module.new creates a new Module and passes it to the provided block"
|
211
208
|
fails "Module::Nesting returns the list of Modules nested at the point of call"
|
@@ -7,13 +7,13 @@ opal_filter "Numeric" do
|
|
7
7
|
fails "Numeric#singleton_method_added raises a TypeError when trying to define a singleton method on a Numeric"
|
8
8
|
fails "Numeric#step Numeric#step with [-infinity, -step] does not yield when self is -infinity"
|
9
9
|
fails "Numeric#step Numeric#step with [-infinity, step] does not yield when self is -infinity"
|
10
|
-
fails "Numeric#step Numeric#step with [infinity, -step] does not yield when self is +infinity"
|
11
10
|
fails "Numeric#step Numeric#step with [infinity, -step] does not yield when self is -infinity"
|
11
|
+
fails "Numeric#step Numeric#step with [infinity, -step] does not yield when self is +infinity"
|
12
12
|
fails "Numeric#step Numeric#step with [infinity, step] does not yield when self is infinity"
|
13
|
-
fails "Numeric#step Numeric#step with [stop, +Infinity] does not yield when stop is -Infinity"
|
14
|
-
fails "Numeric#step Numeric#step with [stop, +step] when self, stop or step is a Float is careful about not yielding a value greater than limit"
|
15
13
|
fails "Numeric#step Numeric#step with [stop, -infinity] does not yield when stop is Infinity"
|
16
14
|
fails "Numeric#step Numeric#step with [stop, -step] when self, stop or step is a Float is careful about not yielding a value smaller than limit"
|
15
|
+
fails "Numeric#step Numeric#step with [stop, +Infinity] does not yield when stop is -Infinity"
|
16
|
+
fails "Numeric#step Numeric#step with [stop, +step] when self, stop or step is a Float is careful about not yielding a value greater than limit"
|
17
17
|
fails "Numeric#step Numeric#step with [stop, step] when self and stop are Fixnums but step is a String raises an ArgumentError if given a block"
|
18
18
|
fails "Numeric#step when no block is given returned Enumerator size raises an ArgumentError when step is 0"
|
19
19
|
fails "Numeric#step when no block is given returned Enumerator size raises an ArgumentError when step is 0.0"
|
data/spec/filters/bugs/proc.rb
CHANGED
@@ -27,7 +27,6 @@ opal_filter "Proc" do
|
|
27
27
|
fails "Proc.new with a block argument called indirectly from a subclass returns the passed proc created from a block"
|
28
28
|
fails "Proc.new with a block argument called indirectly from a subclass returns the passed proc created from a method"
|
29
29
|
fails "Proc.new with a block argument called indirectly from a subclass returns the passed proc created from a symbol"
|
30
|
-
fails "Proc.new with a block argument returns the passed proc created from a method"
|
31
30
|
fails "Proc.new with an associated block called on a subclass of Proc returns an instance of the subclass"
|
32
31
|
fails "Proc.new with an associated block called on a subclass of Proc that does not 'super' in 'initialize' still constructs a functional proc"
|
33
32
|
fails "Proc.new with an associated block called on a subclass of Proc using a reified block parameter returns an instance of the subclass"
|
data/spec/filters/bugs/range.rb
CHANGED
@@ -55,7 +55,6 @@ opal_filter "Range" do
|
|
55
55
|
fails "Range#include? with weird succ when included end value returns false if other is not matched by element.succ"
|
56
56
|
fails "Range#initialize is private"
|
57
57
|
fails "Range#initialize raises a NameError if called on an already initialized Range"
|
58
|
-
fails "Range#initialize raises an ArgumentError if passed with four or more arguments"
|
59
58
|
fails "Range#inspect ignores own untrusted status"
|
60
59
|
fails "Range#inspect returns a tainted string if either end is tainted"
|
61
60
|
fails "Range#inspect returns a untrusted string if either end is untrusted"
|
@@ -73,8 +72,8 @@ opal_filter "Range" do
|
|
73
72
|
fails "Range#max raises TypeError when called on a Time...Time(excluded end point)"
|
74
73
|
fails "Range#max raises TypeError when called on an exclusive range and a non Integer value"
|
75
74
|
fails "Range#max returns nil when the endpoint equals the start point and the range is exclusive"
|
76
|
-
fails "Range#max returns nil when the endpoint is less than the start point in a Float range"
|
77
75
|
fails "Range#max returns nil when the endpoint is less than the start point"
|
76
|
+
fails "Range#max returns nil when the endpoint is less than the start point in a Float range"
|
78
77
|
fails "Range#max returns the maximum value in the range when called with no arguments"
|
79
78
|
fails "Range#member? compares values using <=>"
|
80
79
|
fails "Range#member? on string elements returns false if other is not matched by element.succ"
|
@@ -85,8 +84,8 @@ opal_filter "Range" do
|
|
85
84
|
fails "Range#member? with weird succ when included end value returns false if other is not matched by element.succ"
|
86
85
|
fails "Range#min given a block calls #> and #< on the return value of the block"
|
87
86
|
fails "Range#min returns nil when the endpoint equals the start point and the range is exclusive"
|
88
|
-
fails "Range#min returns nil when the start point is greater than the endpoint in a Float range"
|
89
87
|
fails "Range#min returns nil when the start point is greater than the endpoint"
|
88
|
+
fails "Range#min returns nil when the start point is greater than the endpoint in a Float range"
|
90
89
|
fails "Range#step calls #to_int to coerce step to an Integer"
|
91
90
|
fails "Range#step coerces the argument to integer by invoking to_int"
|
92
91
|
fails "Range#step raises a TypeError if #to_int does not return an Integer"
|
data/spec/filters/bugs/regexp.rb
CHANGED
@@ -9,9 +9,7 @@ opal_filter "regular_expressions" do
|
|
9
9
|
fails "Regexp#inspect does not include the 'o' option"
|
10
10
|
fails "Regexp#inspect does not over escape"
|
11
11
|
fails "Regexp#inspect escapes 2 slashes in a row properly"
|
12
|
-
fails "Regexp#inspect returns a formatted string that would eval to the same regexp"
|
13
12
|
fails "Regexp#inspect returns options in the order 'mixn'"
|
14
|
-
fails "Regexp#source returns the original string of the pattern"
|
15
13
|
fails "Regexp#to_s deals properly with the two types of lookahead groups"
|
16
14
|
fails "Regexp#to_s returns a string in (?xxx:yyy) notation"
|
17
15
|
fails "Regexp#to_s shows all options as excluded if none are selected"
|
@@ -74,9 +72,18 @@ opal_filter "regular_expressions" do
|
|
74
72
|
fails "Regexp.compile given a String with escaped characters accepts '\\r'"
|
75
73
|
fails "Regexp.compile given a String with escaped characters accepts '\\t'"
|
76
74
|
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
|
+
fails "Regexp.compile given a String with escaped characters accepts \\uHHHH followed by characters"
|
83
|
+
fails "Regexp.compile given a String with escaped characters accepts \\uHHHH for a single Unicode codepoint"
|
77
84
|
fails "Regexp.compile given a String with escaped characters accepts a backspace followed by a character"
|
78
|
-
fails "Regexp.compile given a String with escaped characters accepts a combination of escaped octal and hexadecimal digits and \\uHHHH"
|
79
85
|
fails "Regexp.compile given a String with escaped characters accepts a combination of escaped octal and hexadecimal digits and \\u{HHHH}"
|
86
|
+
fails "Regexp.compile given a String with escaped characters accepts a combination of escaped octal and hexadecimal digits and \\uHHHH"
|
80
87
|
fails "Regexp.compile given a String with escaped characters accepts a one-digit hexadecimal value"
|
81
88
|
fails "Regexp.compile given a String with escaped characters accepts a one-digit octal value"
|
82
89
|
fails "Regexp.compile given a String with escaped characters accepts a three-digit octal value"
|
@@ -85,32 +92,23 @@ opal_filter "regular_expressions" do
|
|
85
92
|
fails "Regexp.compile given a String with escaped characters accepts an escaped string interpolation"
|
86
93
|
fails "Regexp.compile given a String with escaped characters accepts characters and escaped hexadecimal digits"
|
87
94
|
fails "Regexp.compile given a String with escaped characters accepts characters and escaped octal digits"
|
88
|
-
fails "Regexp.compile given a String with escaped characters accepts characters followed by \\uHHHH"
|
89
95
|
fails "Regexp.compile given a String with escaped characters accepts characters followed by \\u{HHHH}"
|
96
|
+
fails "Regexp.compile given a String with escaped characters accepts characters followed by \\uHHHH"
|
90
97
|
fails "Regexp.compile given a String with escaped characters accepts escaped hexadecimal and octal digits"
|
91
98
|
fails "Regexp.compile given a String with escaped characters accepts escaped hexadecimal digits and characters"
|
92
|
-
fails "Regexp.compile given a String with escaped characters accepts escaped hexadecimal digits followed by \\uHHHH"
|
93
99
|
fails "Regexp.compile given a String with escaped characters accepts escaped hexadecimal digits followed by \\u{HHHH}"
|
100
|
+
fails "Regexp.compile given a String with escaped characters accepts escaped hexadecimal digits followed by \\uHHHH"
|
94
101
|
fails "Regexp.compile given a String with escaped characters accepts escaped octal digits and characters"
|
95
|
-
fails "Regexp.compile given a String with escaped characters accepts escaped octal digits followed by \\uHHHH"
|
96
102
|
fails "Regexp.compile given a String with escaped characters accepts escaped octal digits followed by \\u{HHHH}"
|
103
|
+
fails "Regexp.compile given a String with escaped characters accepts escaped octal digits followed by \\uHHHH"
|
97
104
|
fails "Regexp.compile given a String with escaped characters accepts multiple consecutive '\\' characters"
|
98
|
-
fails "Regexp.compile given a String with escaped characters accepts \\uHHHH followed by characters"
|
99
|
-
fails "Regexp.compile given a String with escaped characters accepts \\uHHHH for a single Unicode codepoint"
|
100
|
-
fails "Regexp.compile given a String with escaped characters accepts \\u{HHHHHH} for a single Unicode codepoint"
|
101
|
-
fails "Regexp.compile given a String with escaped characters accepts \\u{HHHHH} for a single Unicode codepoint"
|
102
|
-
fails "Regexp.compile given a String with escaped characters accepts \\u{HHHH} followed by characters"
|
103
|
-
fails "Regexp.compile given a String with escaped characters accepts \\u{HHHH} for a single Unicode codepoint"
|
104
|
-
fails "Regexp.compile given a String with escaped characters accepts \\u{HHH} for a single Unicode codepoint"
|
105
|
-
fails "Regexp.compile given a String with escaped characters accepts \\u{HH} for a single Unicode codepoint"
|
106
|
-
fails "Regexp.compile given a String with escaped characters accepts \\u{H} for a single Unicode codepoint"
|
107
105
|
fails "Regexp.compile given a String with escaped characters interprets a digit following a three-digit octal value as a character"
|
108
106
|
fails "Regexp.compile given a String with escaped characters interprets a digit following a two-digit hexadecimal value as a character"
|
109
107
|
fails "Regexp.compile given a String with escaped characters raises a Regexp error if there is a trailing backslash"
|
108
|
+
fails "Regexp.compile given a String with escaped characters raises a RegexpError if \\x is not followed by any hexadecimal digits"
|
110
109
|
fails "Regexp.compile given a String with escaped characters raises a RegexpError if less than four digits are given for \\uHHHH"
|
111
110
|
fails "Regexp.compile given a String with escaped characters raises a RegexpError if more than six hexadecimal digits are given"
|
112
111
|
fails "Regexp.compile given a String with escaped characters raises a RegexpError if the \\u{} escape is empty"
|
113
|
-
fails "Regexp.compile given a String with escaped characters raises a RegexpError if \\x is not followed by any hexadecimal digits"
|
114
112
|
fails "Regexp.compile given a String with escaped characters returns a Regexp with source String having the input String's encoding"
|
115
113
|
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"
|
116
114
|
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"
|
@@ -157,8 +155,8 @@ opal_filter "regular_expressions" do
|
|
157
155
|
fails "Regexp.new given a String with escaped characters accepts '\\M-\\r'"
|
158
156
|
fails "Regexp.new given a String with escaped characters accepts '\\M-\\t'"
|
159
157
|
fails "Regexp.new given a String with escaped characters accepts '\\M-\\v'"
|
160
|
-
fails "Regexp.new given a String with escaped characters raises a RegexpError if more than six hexadecimal digits are given"
|
161
158
|
fails "Regexp.new given a String with escaped characters raises a RegexpError if \\x is not followed by any hexadecimal digits"
|
159
|
+
fails "Regexp.new given a String with escaped characters raises a RegexpError if more than six hexadecimal digits are given"
|
162
160
|
fails "Regexp.new works by default for subclasses with overridden #initialize"
|
163
161
|
fails "Regexp.try_convert returns nil if given an argument that can't be converted to a Regexp"
|
164
162
|
fails "Regexp.try_convert tries to coerce the argument by calling #to_regexp"
|
data/spec/filters/bugs/set.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
opal_filter "Set" do
|
2
2
|
fails "Set#& raises an ArgumentError when passed a non-Enumerable"
|
3
3
|
fails "Set#& returns a new Set containing only elements shared by self and the passed Enumerable"
|
4
|
+
fails "Set#^ raises an ArgumentError when passed a non-Enumerable"
|
5
|
+
fails "Set#^ returns a new Set containing elements that are not in both self and the passed Enumberable"
|
4
6
|
fails "Set#== does not depend on the order of nested Sets"
|
5
7
|
fails "Set#== returns true when the passed Object is a Set and self and the Object contain the same elements"
|
6
8
|
fails "Set#divide divides self into a set of subsets based on the blocks return values"
|
@@ -37,6 +39,4 @@ opal_filter "Set" do
|
|
37
39
|
fails "Set#select! returns nil when self was not modified"
|
38
40
|
fails "Set#select! returns self when self was modified"
|
39
41
|
fails "Set#select! yields every element of self"
|
40
|
-
fails "Set#^ raises an ArgumentError when passed a non-Enumerable"
|
41
|
-
fails "Set#^ returns a new Set containing elements that are not in both self and the passed Enumberable"
|
42
42
|
end
|
data/spec/filters/bugs/string.rb
CHANGED
@@ -1,11 +1,13 @@
|
|
1
1
|
opal_filter "String" do
|
2
|
+
fails "String#[] with Range calls to_int on range arguments"
|
2
3
|
fails "String#bytes agrees with #unpack('C*')"
|
3
4
|
fails "String#bytes returns #bytesize bytes"
|
4
5
|
fails "String#bytes yields each byte to a block if one is given, returning self"
|
5
6
|
fails "String#byteslice with Range calls to_int on range arguments"
|
6
|
-
fails "String#clone copies modules included in the singleton class"
|
7
7
|
fails "String#dump includes .force_encoding(name) if the encoding isn't ASCII compatible"
|
8
8
|
fails "String#dump returns a string with # not escaped when followed by any other character"
|
9
|
+
fails "String#dump returns a string with \" and \\ escaped with a backslash"
|
10
|
+
fails "String#dump returns a string with \\#<char> when # is followed by $, @, {"
|
9
11
|
fails "String#dump returns a string with lower-case alpha characters unescaped"
|
10
12
|
fails "String#dump returns a string with multi-byte UTF-8 characters replaced by \\u{} notation with lower-case hex digits"
|
11
13
|
fails "String#dump returns a string with non-printing ASCII characters replaced by \\x notation"
|
@@ -14,8 +16,6 @@ opal_filter "String" do
|
|
14
16
|
fails "String#dump returns a string with printable non-alphanumeric characters unescaped"
|
15
17
|
fails "String#dump returns a string with special characters replaced with \\<char> notation"
|
16
18
|
fails "String#dump returns a string with upper-case alpha characters unescaped"
|
17
|
-
fails "String#dump returns a string with \" and \\ escaped with a backslash"
|
18
|
-
fails "String#dump returns a string with \\#<char> when # is followed by $, @, {"
|
19
19
|
fails "String#dump returns a subclass instance"
|
20
20
|
fails "String#dump taints the result if self is tainted"
|
21
21
|
fails "String#dump untrusts the result if self is untrusted"
|
@@ -36,8 +36,8 @@ opal_filter "String" do
|
|
36
36
|
fails "String#getbyte starts indexing at 0"
|
37
37
|
fails "String#slice with Range calls to_int on range arguments"
|
38
38
|
fails "String#split with Regexp includes all captures in the result array"
|
39
|
-
fails "String#to_c returns a complex number with 0 as the real part, 0 as the imaginary part for unrecognised Strings"
|
40
39
|
fails "String#to_c returns a Complex object"
|
40
|
+
fails "String#to_c returns a complex number with 0 as the real part, 0 as the imaginary part for unrecognised Strings"
|
41
41
|
fails "String#to_c understands 'a+bi' to mean a complex number with 'a' as the real part, 'b' as the imaginary"
|
42
42
|
fails "String#to_c understands 'a-bi' to mean a complex number with 'a' as the real part, '-b' as the imaginary"
|
43
43
|
fails "String#to_c understands a '-i' by itself as denoting a complex number with an imaginary part of -1"
|
@@ -72,5 +72,29 @@ opal_filter "String" do
|
|
72
72
|
fails "String#to_r treats leading hypens as minus signs"
|
73
73
|
fails "String#to_r understands a forward slash as separating the numerator from the denominator"
|
74
74
|
fails "String#to_r understands decimal points"
|
75
|
-
fails "String#
|
75
|
+
fails "String#unicode_normalize defaults to the nfc normalization form if no forms are specified"
|
76
|
+
fails "String#unicode_normalize normalizes code points in the string according to the form that is specified"
|
77
|
+
fails "String#unicode_normalize raises an ArgumentError if the specified form is invalid"
|
78
|
+
fails "String#unicode_normalize raises an Encoding::CompatibilityError if string is not in an unicode encoding"
|
79
|
+
fails "String#unicode_normalize returns normalized form of string by default 03D3 (ϓ) GREEK UPSILON WITH ACUTE AND HOOK SYMBOL"
|
80
|
+
fails "String#unicode_normalize returns normalized form of string by default 03D4 (ϔ) GREEK UPSILON WITH DIAERESIS AND HOOK SYMBOL"
|
81
|
+
fails "String#unicode_normalize returns normalized form of string by default 1E9B (ẛ) LATIN SMALL LETTER LONG S WITH DOT ABOVE"
|
82
|
+
fails "String#unicode_normalize! modifies original string (nfc)"
|
83
|
+
fails "String#unicode_normalize! modifies self in place (nfd)"
|
84
|
+
fails "String#unicode_normalize! modifies self in place (nfkc)"
|
85
|
+
fails "String#unicode_normalize! modifies self in place (nfkd)"
|
86
|
+
fails "String#unicode_normalize! normalizes code points and modifies the receiving string"
|
87
|
+
fails "String#unicode_normalize! raises an ArgumentError if the specified form is invalid"
|
88
|
+
fails "String#unicode_normalize! raises an Encoding::CompatibilityError if the string is not in an unicode encoding"
|
89
|
+
fails "String#unicode_normalized? defaults to the nfc normalization form if no forms are specified"
|
90
|
+
fails "String#unicode_normalized? raises an ArgumentError if the specified form is invalid"
|
91
|
+
fails "String#unicode_normalized? raises an Encoding::CompatibilityError if the string is not in an unicode encoding"
|
92
|
+
fails "String#unicode_normalized? returns false if string is not in the supplied normalization form"
|
93
|
+
fails "String#unicode_normalized? returns true if str is in Unicode normalization form (nfc)"
|
94
|
+
fails "String#unicode_normalized? returns true if str is in Unicode normalization form (nfd)"
|
95
|
+
fails "String#unicode_normalized? returns true if str is in Unicode normalization form (nfkc)"
|
96
|
+
fails "String#unicode_normalized? returns true if str is in Unicode normalization form (nfkd)"
|
97
|
+
fails "String#unicode_normalized? returns true if string does not contain any unicode codepoints"
|
98
|
+
fails "String#unicode_normalized? returns true if string is empty"
|
99
|
+
fails "String#unicode_normalized? returns true if string is in the specified normalization form"
|
76
100
|
end
|
@@ -1,4 +1,9 @@
|
|
1
1
|
opal_filter "StringScanner" do
|
2
|
+
fails "StringScanner#[] calls to_int on the given index"
|
3
|
+
fails "StringScanner#[] raises a IndexError when there's no named capture"
|
4
|
+
fails "StringScanner#[] raises a TypeError if the given index is nil"
|
5
|
+
fails "StringScanner#[] raises a TypeError when a Range is as argument"
|
6
|
+
fails "StringScanner#[] returns named capture"
|
2
7
|
fails "StringScanner#<< concatenates the given argument to self and returns self"
|
3
8
|
fails "StringScanner#<< raises a TypeError if the given argument can't be converted to a String"
|
4
9
|
fails "StringScanner#<< when passed a Fixnum doesn't call to_int on the argument"
|
@@ -26,7 +31,6 @@ opal_filter "StringScanner" do
|
|
26
31
|
fails "StringScanner#initialize is a private method"
|
27
32
|
fails "StringScanner#inspect returns a string that represents the StringScanner object"
|
28
33
|
fails "StringScanner#matched returns an instance of String when passed a String subclass"
|
29
|
-
fails "StringScanner#matched returns nil if there's no match"
|
30
34
|
fails "StringScanner#matched returns the last matched string"
|
31
35
|
fails "StringScanner#matched taints the returned String if the input was tainted"
|
32
36
|
fails "StringScanner#matched? returns false if there's no match"
|
@@ -58,23 +62,18 @@ opal_filter "StringScanner" do
|
|
58
62
|
fails "StringScanner#restsize Returns the length of the rest of the string"
|
59
63
|
fails "StringScanner#restsize warns in verbose mode that the method is obsolete"
|
60
64
|
fails "StringScanner#scan raises a TypeError if pattern isn't a Regexp"
|
61
|
-
fails "StringScanner#scan_full returns the matched string if the third argument is true and advances the scan pointer if the second argument is true"
|
62
65
|
fails "StringScanner#scan_full returns the matched string if the third argument is true"
|
63
|
-
fails "StringScanner#scan_full returns the
|
66
|
+
fails "StringScanner#scan_full returns the matched string if the third argument is true and advances the scan pointer if the second argument is true"
|
64
67
|
fails "StringScanner#scan_full returns the number of bytes advanced"
|
65
|
-
fails "StringScanner#
|
68
|
+
fails "StringScanner#scan_full returns the number of bytes advanced and advances the scan pointer if the second argument is true"
|
66
69
|
fails "StringScanner#search_full returns the matched string if the third argument is true"
|
67
|
-
fails "StringScanner#search_full returns the
|
70
|
+
fails "StringScanner#search_full returns the matched string if the third argument is true and advances the scan pointer if the second argument is true"
|
68
71
|
fails "StringScanner#search_full returns the number of bytes advanced"
|
72
|
+
fails "StringScanner#search_full returns the number of bytes advanced and advances the scan pointer if the second argument is true"
|
69
73
|
fails "StringScanner#string returns the string being scanned"
|
70
74
|
fails "StringScanner#string= changes the string being scanned to the argument and resets the scanner"
|
71
75
|
fails "StringScanner#string= converts the argument into a string using #to_str"
|
72
76
|
fails "StringScanner#unscan raises a ScanError when the previous match had failed"
|
73
77
|
fails "StringScanner#unscan set the scan pointer to the previous position"
|
74
|
-
fails "StringScanner#[] calls to_int on the given index"
|
75
|
-
fails "StringScanner#[] raises a IndexError when there's no named capture"
|
76
|
-
fails "StringScanner#[] raises a TypeError if the given index is nil"
|
77
|
-
fails "StringScanner#[] raises a TypeError when a Range is as argument"
|
78
|
-
fails "StringScanner#[] returns named capture"
|
79
78
|
fails "StringScanner.must_C_version returns self"
|
80
79
|
end
|
data/spec/filters/bugs/struct.rb
CHANGED
@@ -2,15 +2,11 @@ opal_filter "Struct" do
|
|
2
2
|
fails "Struct#hash returns the same fixnum for structs with the same content"
|
3
3
|
fails "Struct#initialize can be overriden"
|
4
4
|
fails "Struct#inspect returns a string representation of some kind"
|
5
|
-
fails "Struct#instance_variables returns an array with one name if an instance variable is added"
|
6
|
-
fails "Struct#instance_variables returns an empty array if only attributes are defined"
|
7
5
|
fails "Struct#members does not override the instance accessor method"
|
8
6
|
fails "Struct.new calls to_str on its first argument (constant name)"
|
9
|
-
fails "Struct.new creates a constant in subclass' namespace"
|
10
7
|
fails "Struct.new creates a new anonymous class with nil first argument"
|
11
8
|
fails "Struct.new does not create a constant with symbol as first argument"
|
12
9
|
fails "Struct.new fails with invalid constant name as first argument"
|
13
|
-
fails "Struct.new fails with too many arguments"
|
14
10
|
fails "Struct.new on subclasses creates a constant in subclass' namespace"
|
15
11
|
fails "Struct.new on subclasses fails with too many arguments"
|
16
12
|
fails "Struct.new raises a TypeError if object doesn't respond to to_sym"
|
data/spec/filters/bugs/time.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
opal_filter "Time" do
|
2
2
|
fails "Time#getlocal raises ArgumentError if the String argument is not in an ASCII-compatible encoding"
|
3
3
|
fails "Time#inspect formats the fixed offset time following the pattern 'yyyy-MM-dd HH:mm:ss +/-HHMM'"
|
4
|
-
fails "Time#inspect formats the local time following the pattern 'yyyy-MM-dd HH:mm:ss Z'"
|
5
4
|
fails "Time#localtime raises ArgumentError if the String argument is not in an ASCII-compatible encoding"
|
6
5
|
fails "Time#round copies own timezone to the returning value"
|
7
6
|
fails "Time#round defaults to rounding to 0 places"
|
@@ -13,7 +12,6 @@ opal_filter "Time" do
|
|
13
12
|
fails "Time#strftime should be able to print the commercial year with only two digits"
|
14
13
|
fails "Time#strftime should be able to print the julian day with leading zeroes"
|
15
14
|
fails "Time#strftime should be able to show the commercial week day"
|
16
|
-
fails "Time#strftime should be able to show the commercial week"
|
17
15
|
fails "Time#strftime should be able to show the number of seconds since the unix epoch"
|
18
16
|
fails "Time#strftime should be able to show the timezone if available"
|
19
17
|
fails "Time#strftime should be able to show the timezone of the date with a : separator"
|
@@ -25,5 +23,6 @@ opal_filter "Time" do
|
|
25
23
|
fails "Time#strftime with %N formats the picoseconds of the second with %12N"
|
26
24
|
fails "Time#to_f returns the float number of seconds + usecs since the epoch"
|
27
25
|
fails "Time#to_s formats the fixed offset time following the pattern 'yyyy-MM-dd HH:mm:ss +/-HHMM'"
|
28
|
-
fails "Time#
|
26
|
+
fails "Time#zone Encoding.default_internal is set returns an ASCII string"
|
27
|
+
fails "Time.at passed Numeric roundtrips a Rational produced by #to_r"
|
29
28
|
end
|