opal 0.6.0 → 0.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.gitmodules +27 -3
  4. data/.rspec +1 -1
  5. data/CHANGELOG.md +29 -5
  6. data/README.md +30 -3
  7. data/Rakefile +18 -9
  8. data/bin/opal +1 -1
  9. data/bin/opal-build +70 -7
  10. data/lib/mspec/opal/rake_task.rb +6 -9
  11. data/lib/opal/cli.rb +2 -2
  12. data/lib/opal/nodes/call.rb +1 -1
  13. data/lib/opal/nodes/def.rb +1 -1
  14. data/lib/opal/nodes/rescue.rb +19 -18
  15. data/lib/opal/parser/grammar.rb +8 -3
  16. data/lib/opal/parser/grammar.y +4 -0
  17. data/lib/opal/parser/lexer.rb +10 -5
  18. data/lib/opal/sprockets/environment.rb +9 -0
  19. data/lib/opal/sprockets/erb.rb +9 -1
  20. data/lib/opal/sprockets/processor.rb +10 -14
  21. data/lib/opal/util.rb +50 -15
  22. data/lib/opal/version.rb +1 -1
  23. data/opal.gemspec +4 -4
  24. data/opal/corelib/enumerable.rb +1 -1
  25. data/opal/corelib/enumerator.rb +7 -3
  26. data/opal/corelib/hash.rb +38 -14
  27. data/opal/corelib/kernel.rb +6 -2
  28. data/opal/corelib/module.rb +15 -1
  29. data/opal/corelib/runtime.js +32 -2
  30. data/opal/corelib/string.rb +103 -53
  31. data/opal/corelib/variables.rb +3 -3
  32. data/spec/cli/fixtures/sprockets_file.js.rb +3 -0
  33. data/spec/cli/parser/literal_spec.rb +5 -0
  34. data/spec/cli/sprockets/environment_spec.rb +14 -0
  35. data/spec/cli/sprockets/erb_spec.rb +25 -0
  36. data/spec/cli/sprockets/processor_spec.rb +28 -0
  37. data/spec/{opal/filters → filters}/bugs/array.rb +29 -9
  38. data/spec/{opal/filters → filters}/bugs/basic_object.rb +2 -0
  39. data/spec/{opal/filters → filters}/bugs/class.rb +1 -0
  40. data/spec/{opal/filters → filters}/bugs/enumerable.rb +6 -2
  41. data/spec/filters/bugs/enumerator.rb +3 -0
  42. data/spec/{opal/filters → filters}/bugs/hash.rb +6 -24
  43. data/spec/{opal/filters → filters}/bugs/kernel.rb +0 -0
  44. data/spec/{opal/filters → filters}/bugs/language.rb +14 -3
  45. data/spec/{opal/filters → filters}/bugs/math.rb +3 -1
  46. data/spec/{opal/filters → filters}/bugs/module.rb +0 -0
  47. data/spec/{opal/filters → filters}/bugs/nil.rb +0 -0
  48. data/spec/{opal/filters → filters}/bugs/numeric.rb +1 -1
  49. data/spec/{opal/filters → filters}/bugs/opal.rb +0 -0
  50. data/spec/filters/bugs/regexp.rb +7 -0
  51. data/spec/{opal/filters → filters}/bugs/set.rb +0 -0
  52. data/spec/{opal/filters → filters}/bugs/singleton.rb +0 -0
  53. data/spec/{opal/filters → filters}/bugs/string.rb +40 -13
  54. data/spec/{opal/filters → filters}/bugs/stringscanner.rb +1 -0
  55. data/spec/{opal/filters → filters}/bugs/struct.rb +7 -2
  56. data/spec/{opal/filters → filters}/bugs/symbol.rb +0 -0
  57. data/spec/{opal/filters → filters}/bugs/time.rb +23 -0
  58. data/spec/{opal/filters → filters}/bugs/unknown.rb +0 -0
  59. data/spec/{opal/filters → filters}/unsupported/encoding.rb +34 -1
  60. data/spec/{opal/filters → filters}/unsupported/enumerator.rb +1 -0
  61. data/spec/{opal/filters → filters}/unsupported/float.rb +0 -0
  62. data/spec/{opal/filters → filters}/unsupported/frozen.rb +3 -2
  63. data/spec/{opal/filters → filters}/unsupported/hash_compare_by_identity.rb +0 -0
  64. data/spec/{opal/filters → filters}/unsupported/integer_size.rb +0 -0
  65. data/spec/{opal/filters → filters}/unsupported/method_added.rb +0 -0
  66. data/spec/{opal/filters → filters}/unsupported/mutable_strings.rb +14 -0
  67. data/spec/{opal/filters → filters}/unsupported/private_constants.rb +0 -0
  68. data/spec/{opal/filters → filters}/unsupported/private_methods.rb +0 -0
  69. data/spec/{opal/filters → filters}/unsupported/random.rb +0 -0
  70. data/spec/{opal/filters → filters}/unsupported/ruby_exe.rb +0 -0
  71. data/spec/{opal/filters → filters}/unsupported/tainted.rb +11 -0
  72. data/spec/{opal/filters → filters}/unsupported/time.rb +0 -0
  73. data/spec/{opal/filters → filters}/unsupported/trusted.rb +14 -0
  74. data/spec/opal/core/kernel/methods_spec.rb +16 -2
  75. data/spec/opal/core/language/string_spec.rb +29 -1
  76. data/spec/opal/core/module/remove_const_spec.rb +1 -1
  77. data/spec/opal/stdlib/erb/erb_spec.rb +3 -3
  78. data/spec/opal/stdlib/native/native_reader_spec.rb +22 -0
  79. data/spec/opal/stdlib/native/native_writer_spec.rb +30 -0
  80. data/spec/rubyspecs +285 -0
  81. data/spec/{opal/spec_helper.rb → spec_helper.rb} +0 -0
  82. data/stdlib/native.rb +21 -0
  83. data/stdlib/opal-parser.rb +14 -3
  84. data/stdlib/promise.rb +2 -2
  85. metadata +113 -97
  86. data/spec/opal/filters/bugs/regexp.rb +0 -5
  87. data/spec/opal/rubyspecs +0 -285
@@ -1,5 +1,7 @@
1
1
  opal_filter "BasicObject" do
2
2
  fails "BasicObject#instance_eval evaluates strings"
3
+ fails "BasicObject#singleton_method_added is called when a method is defined with alias_method in the singleton class"
4
+ fails "BasicObject#singleton_method_added is called when a method is defined with syntax alias in the singleton class"
3
5
  fails "BasicObject instance metaclass contains methods defined for the BasicObject instance"
4
6
  fails "BasicObject instance metaclass has BasicObject as superclass"
5
7
  fails "BasicObject instance metaclass is an instance of Class"
@@ -12,6 +12,7 @@ opal_filter "Class" do
12
12
  fails "Class#initialize_copy raises a TypeError when called on BasicObject"
13
13
  fails "Class#initialize raises a TypeError when called on already initialized classes"
14
14
  fails "Class#initialize raises a TypeError when called on BasicObject"
15
+ fails "Class#initialize when given the Class raises a TypeError"
15
16
 
16
17
  fails "Class.new raises a TypeError if passed a metaclass"
17
18
  fails "Class#new passes the block to #initialize"
@@ -19,6 +19,8 @@ opal_filter "Enumerable" do
19
19
  fails "Enumerable#chunk yields the current element and the current chunk to the block"
20
20
  fails "Enumerable#chunk returns an Enumerator if given a block"
21
21
  fails "Enumerable#chunk raises an ArgumentError if called without a block"
22
+ fails "Enumerable#chunk with [initial_state] yields an element and an object value-equal but not identical to the object passed to #chunk"
23
+ fails "Enumerable#chunk with [initial_state] does not yield the object passed to #chunk if it is nil"
22
24
 
23
25
  fails "Enumerable#each_cons gathers whole arrays as elements when each yields multiple"
24
26
  fails "Enumerable#each_cons returns an enumerator if no block"
@@ -42,7 +44,7 @@ opal_filter "Enumerable" do
42
44
  fails "Enumerable#minmax_by returns an enumerator if no block"
43
45
 
44
46
  fails "Enumerable#minmax gathers whole arrays as elements when each yields multiple"
45
- fails "Enumerable#minmax return the minimun when using a block rule"
47
+ fails "Enumerable#minmax returns the minimum when using a block rule"
46
48
  fails "Enumerable#minmax raises a NoMethodError for elements without #<=>"
47
49
  fails "Enumerable#minmax raises an ArgumentError when elements are incomparable"
48
50
  fails "Enumerable#minmax returns [nil, nil] for an empty Enumerable"
@@ -56,7 +58,9 @@ opal_filter "Enumerable" do
56
58
  fails "Enumerable#sort sorts enumerables that contain nils"
57
59
  fails "Enumerable#sort raises a NoMethodError if elements do not define <=>"
58
60
  fails "Enumerable#sort yields elements to the provided block"
59
- fails "Enumerable#sort sorts by the natural order as defined by <=> "
61
+ fails "Enumerable#sort sorts by the natural order as defined by <=>"
62
+
63
+ fails "Enumerable#take_while calls the block with initial args when yielded with multiple arguments"
60
64
 
61
65
  fails "Enumerable#zip passes each element of the result array to a block and return nil if a block is given"
62
66
  fails "Enumerable#zip converts arguments to arrays using #to_ary"
@@ -0,0 +1,3 @@
1
+ opal_filter "Enumerator" do
2
+ fails "Enumerator#each requires multiple arguments" # arity issue
3
+ end
@@ -1,32 +1,18 @@
1
1
  opal_filter "Hash" do
2
- fails "Hash includes Enumerable"
3
-
4
- fails "Hash#assoc only returns the first matching key-value pair for identity hashes"
5
-
6
- fails "Hash.[] creates a Hash; values can be provided as a list of value-pairs in an array"
7
2
  fails "Hash.[] coerces a single argument which responds to #to_ary"
8
3
  fails "Hash.[] ignores elements that are not arrays"
9
- fails "Hash.[] raises an ArgumentError for arrays of more than 2 elements"
10
- fails "Hash.[] raises an ArgumentError when passed a list of value-invalid-pairs in an array"
11
- fails "Hash.[] raises an ArgumentError when passed an odd number of arguments"
12
4
  fails "Hash.[] calls to_hash"
13
5
  fails "Hash.[] returns an instance of a subclass when passed an Array"
14
6
  fails "Hash.[] returns instances of subclasses"
15
7
  fails "Hash.[] returns an instance of the class it's called on"
16
8
  fails "Hash.[] does not call #initialize on the subclass instance"
17
- fails "Hash.[] passed an array treats elements that are 2 element arrays as key and value"
18
9
  fails "Hash.[] passed an array treats elements that are 1 element arrays as keys with value nil"
19
10
  fails "Hash.[] passed a single argument which responds to #to_hash coerces it and returns a copy"
11
+ fails "Hash.[] removes the default_proc"
20
12
 
21
- fails "Hash#default_proc= uses :to_proc on its argument"
22
- fails "Hash#default_proc= overrides the static default"
23
- fails "Hash#default_proc= raises an error if passed stuff not convertible to procs"
24
- fails "Hash#default_proc= raises a TypeError if passed a lambda with an arity other than 2"
25
-
26
- fails "Hash#default uses the default proc to compute a default value, passing given key"
27
- fails "Hash#default= unsets the default proc"
13
+ fails "Hash#assoc only returns the first matching key-value pair for identity hashes"
28
14
 
29
- fails "Hash#delete calls supplied block if the key is not found"
15
+ fails "Hash#default_proc= uses :to_proc on its argument"
30
16
 
31
17
  fails "Hash#each properly expands (or not) child class's 'each'-yielded args"
32
18
  fails "Hash#each yields the key only to a block expecting |key,|"
@@ -42,7 +28,6 @@ opal_filter "Hash" do
42
28
  fails "Hash#== computes equality for complex recursive hashes"
43
29
  fails "Hash#== does not compare keys with different hash codes via eql?"
44
30
  fails "Hash#== first compares keys via hash"
45
- fails "Hash#== does not compare values when keys don't match"
46
31
 
47
32
  fails "Hash#eql? compares the values in self to values in other hash"
48
33
  fails "Hash#eql? returns true iff other Hash has the same number of keys and each key-value pair matches"
@@ -68,7 +53,7 @@ opal_filter "Hash" do
68
53
  fails "Hash#fetch raises an ArgumentError when not passed one or two arguments"
69
54
 
70
55
  fails "Hash#flatten recursively flattens Array values to the given depth"
71
- fails "Hash#flatten raises an TypeError if given a non-Integer argument"
56
+ fails "Hash#flatten raises a TypeError if given a non-Integer argument"
72
57
 
73
58
  fails "Hash#has_key? compares keys with the same #hash value via #eql?"
74
59
  fails "Hash#has_key? returns true if argument is a key"
@@ -96,11 +81,8 @@ opal_filter "Hash" do
96
81
  fails "Hash#member? compares keys with the same #hash value via #eql?"
97
82
  fails "Hash#member? returns true if argument is a key"
98
83
 
99
- fails "Hash#merge tries to convert the passed argument to a hash using #to_hash"
100
84
  fails "Hash#merge returns subclass instance for subclasses"
101
85
 
102
- fails "Hash#merge! tries to convert the passed argument to a hash using #to_hash"
103
-
104
86
  fails "Hash.new raises an ArgumentError if more than one argument is passed"
105
87
  fails "Hash.new raises an ArgumentError if passed both default argument and default block"
106
88
 
@@ -131,6 +113,8 @@ opal_filter "Hash" do
131
113
  fails "Hash#sort works when some of the keys are themselves arrays"
132
114
  fails "Hash#sort uses block to sort array if passed a block"
133
115
 
116
+ fails "Hash#to_h returns self for Hash instances"
117
+
134
118
  fails "Hash#to_s handles hashes with recursive values"
135
119
 
136
120
  fails "Hash.try_convert does not rescue exceptions raised by #to_hash"
@@ -141,6 +125,4 @@ opal_filter "Hash" do
141
125
  fails "Hash.try_convert returns nil when the argument does not respond to #to_hash"
142
126
  fails "Hash.try_convert returns the argument if it's a kind of Hash"
143
127
  fails "Hash.try_convert returns the argument if it's a Hash"
144
-
145
- fails "Hash#update tries to convert the passed argument to a hash using #to_hash"
146
128
  end
File without changes
@@ -8,6 +8,7 @@ opal_filter "language" do
8
8
  fails "The alias keyword adds the new method to the list of methods"
9
9
 
10
10
  fails "The unpacking splat operator (*) when applied to a non-Array value attempts to coerce it to Array if the object respond_to?(:to_a)"
11
+ fails "The unpacking splat operator (*) when applied to a non-Array value attempts to coerce it to Array if the object respond_to?(:to_ary)"
11
12
  fails "The unpacking splat operator (*) returns a new array containing the same values when applied to an array inside an empty array"
12
13
  fails "The unpacking splat operator (*) unpacks the start and count arguments in an array slice assignment"
13
14
  fails "The unpacking splat operator (*) unpacks arguments as if they were listed statically"
@@ -155,6 +156,10 @@ opal_filter "language" do
155
156
  fails "The defined? keyword for an expression with logical connectives returns nil for an expression with '!' and an unset global variable"
156
157
  fails "The defined? keyword for an expression with logical connectives returns nil for an expression with 'not' and an unset class variable"
157
158
  fails "The defined? keyword for an expression with logical connectives returns nil for an expression with '!' and an unset class variable"
159
+ fails "The defined? keyword for loop expressions returns 'expression' for a 'for' expression"
160
+ fails "The defined? keyword for loop expressions returns 'expression' for a 'retry' expression"
161
+ fails "The defined? keyword for literals for a literal Array returns nil if one element is not defined"
162
+ fails "The defined? keyword for literals for a literal Array returns nil if all elements are not defined"
158
163
  fails "The defined? keyword for variables returns nil for a global variable that has been read but not assigned to"
159
164
 
160
165
  fails "An ensure block inside a begin block is executed even when a symbol is thrown in it's corresponding begin block"
@@ -220,6 +225,10 @@ opal_filter "language" do
220
225
  fails "A method call evaluates block pass after arguments"
221
226
  fails "A method call evaluates arguments after receiver"
222
227
 
228
+ fails "not() returns false if the argument is true"
229
+ fails "not() returns true if the argument is false"
230
+ fails "not() returns true if the argument is nil"
231
+
223
232
  fails "Operators or/and have higher precedence than if unless while until modifiers"
224
233
  fails "Operators = %= /= -= += |= &= >>= <<= *= &&= ||= **= have higher precedence than defined? operator"
225
234
  fails "Operators = %= /= -= += |= &= >>= <<= *= &&= ||= **= are right-associative"
@@ -251,18 +260,20 @@ opal_filter "language" do
251
260
  fails "A Proc taking || arguments raises an ArgumentError if a value is passed"
252
261
  fails "A Proc taking zero arguments raises an ArgumentErro if a value is passed"
253
262
 
263
+ fails "The redo statement raises a LocalJumpError if used not within block or while/for loop"
264
+
254
265
  fails "The rescue keyword parses 'a += b rescue c' as 'a += (b rescue c)'"
255
266
  fails "The rescue keyword will not rescue errors raised in an else block in the rescue block above it"
256
267
  fails "The rescue keyword will not execute an else block if an exception was raised"
257
268
  fails "The rescue keyword will execute an else block only if no exceptions were raised"
258
- fails "The rescue keyword will only rescue the specified exceptions when doing a splat rescue"
259
- fails "The rescue keyword can rescue a splatted list of exceptions"
260
- fails "The rescue keyword can rescue multiple raised exceptions with a single rescue block"
261
269
 
262
270
  fails "The retry statement re-executes the closest block"
271
+ fails "The retry statement re-executes the entire enumeration"
263
272
  fails "The retry statement raises a SyntaxError when used outside of a begin statement"
273
+ fails "The retry statement raises a LocalJumpError if used outside of a block"
264
274
  fails "The retry keyword inside a begin block's rescue block causes the begin block to be executed again"
265
275
 
276
+
266
277
  fails "The return keyword within a begin returns last value returned in nested ensures"
267
278
  fails "The return keyword within a begin executes nested ensures before returning"
268
279
  fails "The return keyword when passed a splat calls 'to_a' on the splatted value first"
@@ -7,6 +7,8 @@ opal_filter "Math" do
7
7
  fails "Math.erf accepts any argument that can be coerced with Float()"
8
8
  fails "Math#erf is accessible as a private instance method"
9
9
 
10
+ fails "Math.erfc returns the complementary error function of the argument"
11
+
10
12
  fails "Math.frexp returns the normalized fraction and exponent"
11
13
  fails "Math.frexp raises a TypeError if the argument cannot be coerced with Float()"
12
14
  fails "Math.frexp returns NaN given NaN"
@@ -27,7 +29,7 @@ opal_filter "Math" do
27
29
  fails "Math.ldexp raises a TypeError if the first argument cannot be coerced with Float()"
28
30
  fails "Math.ldexp returns NaN given NaN"
29
31
  fails "Math.ldexp raises RangeError if NaN is given as the second arg"
30
- fails "Math.ldexp raises an TypeError if the second argument cannot be coerced with Integer()"
32
+ fails "Math.ldexp raises a TypeError if the second argument cannot be coerced with Integer()"
31
33
  fails "Math.ldexp raises a TypeError if the first argument is nil"
32
34
  fails "Math.ldexp raises a TypeError if the second argument is nil"
33
35
  fails "Math.ldexp accepts any first argument that can be coerced with Float()"
File without changes
File without changes
@@ -1,5 +1,5 @@
1
1
  opal_filter "Fixnum bugs" do
2
- fails "Integer#downto [stop] when self and stop are Fixnums raises a ArgumentError for invalid endpoints"
2
+ fails "Integer#downto [stop] when self and stop are Fixnums raises an ArgumentError for invalid endpoints"
3
3
 
4
4
  fails "Fixnum#to_s when no base given returns self converted to a String using base 10"
5
5
 
File without changes
@@ -0,0 +1,7 @@
1
+ opal_filter "RegExp" do
2
+ fails "Regexp#~ matches against the contents of $_"
3
+ fails "Regexp#match uses the start as a character offset"
4
+ fails "Regexp#match matches the input at a given position"
5
+ fails "Regexp#match with [string, position] when given a positive position matches the input at a given position"
6
+ fails "Regexp#match with [string, position] when given a negative position matches the input at a given position"
7
+ end
File without changes
File without changes
@@ -36,10 +36,12 @@ opal_filter "String" do
36
36
  fails "String#[] with String returns a subclass instance when given a subclass instance"
37
37
 
38
38
  fails "String#dup does not copy constants defined in the singleton class"
39
+ fails "String#dup does not modify the original string when changing dupped string"
39
40
 
40
41
  fails "String#end_with? converts its argument using :to_str"
41
42
  fails "String#end_with? returns true if other is empty"
42
43
 
44
+ fails "String#each_line accepts a string separator"
43
45
  fails "String#each_line passes self as a whole to the block if the separator is nil"
44
46
  fails "String#each_line yields paragraphs (broken by 2 or more successive newlines) when passed ''"
45
47
  fails "String#each_line uses $/ as the separator when none is given"
@@ -88,6 +90,7 @@ opal_filter "String" do
88
90
  fails "String#intern does not special case certain operators"
89
91
  fails "String#intern special cases +(binary) and -(binary)"
90
92
 
93
+ fails "String#lines accepts a string separator"
91
94
  fails "String#lines should split on the default record separator and return enumerator if not block is given"
92
95
  fails "String#lines splits using default newline separator when none is specified"
93
96
  fails "String#lines splits self using the supplied record separator and passes each substring to the block"
@@ -110,11 +113,12 @@ opal_filter "String" do
110
113
  fails "String#next increases the next best character if there is a carry for non-alphanumerics"
111
114
  fails "String#next adds an additional character (just left to the last increased one) if there is a carry and no character left to increase"
112
115
 
116
+
113
117
  fails "String#partition with String accepts regexp"
114
118
  fails "String#partition with String sets global vars if regexp used"
115
119
  fails "String#partition with String converts its argument using :to_str"
116
120
  fails "String#partition with String converts its argument using :to_str"
117
- fails "String#partition with String raises error if not convertible to string"
121
+ fails "String#partition with String raises an error if not convertible to string"
118
122
 
119
123
  fails "String#rindex with object raises a TypeError if obj isn't a String, Fixnum or Regexp"
120
124
  fails "String#rindex with object tries to convert obj to a string via to_str"
@@ -163,18 +167,9 @@ opal_filter "String" do
163
167
  fails "String#slice with Regexp, group"
164
168
 
165
169
  fails "String#split with String returns subclass instances based on self"
166
- fails "String#split with Regexp divides self on regexp matches"
167
- fails "String#split with Regexp treats negative limits as no limit"
168
- fails "String#split with Regexp suppresses trailing empty fields when limit isn't given or 0"
169
- fails "String#split with Regexp returns an array with one entry if limit is 1: the original string"
170
- fails "String#split with Regexp returns at most limit fields when limit > 1"
171
- fails "String#split with Regexp defaults to $; when regexp isn't given or nil"
172
- fails "String#split with Regexp splits between characters when regexp matches a zero-length string"
173
170
  fails "String#split with Regexp respects $KCODE when splitting between characters"
174
171
  fails "String#split with Regexp includes all captures in the result array"
175
172
  fails "String#split with Regexp does not include non-matching captures in the result array"
176
- fails "String#split with Regexp tries converting limit to an integer via to_int"
177
- fails "String#split with Regexp returns a type error if limit can't be converted to an integer"
178
173
  fails "String#split with Regexp returns subclass instances based on self"
179
174
  fails "String#split with Regexp does not call constructor on created subclass instances"
180
175
  fails "String#split with String does not call constructor on created subclass instances"
@@ -219,11 +214,13 @@ opal_filter "String" do
219
214
  fails "String#sum tries to convert n to an integer using to_int"
220
215
  fails "String#sum returns sum of the bytes in self if n less or equal to zero"
221
216
 
217
+ fails "String#to_str returns a new instance of String when called on a subclass"
218
+
222
219
  fails "String#to_sym does not special case certain operators"
223
220
  fails "String#to_sym special cases +(binary) and -(binary)"
224
221
 
225
- fails "String#tr raises a ArgumentError a descending range in the replacement as containing just the start character"
226
- fails "String#tr raises a ArgumentError a descending range in the source as empty"
222
+ fails "String#tr raises an ArgumentError a descending range in the replacement as containing just the start character"
223
+ fails "String#tr raises an ArgumentError a descending range in the source as empty"
227
224
  fails "String#tr translates chars not in from_string when it starts with a ^"
228
225
  fails "String#tr tries to convert from_str and to_str to strings using to_str"
229
226
  fails "String#tr tries to convert from_str and to_str to strings using to_str"
@@ -234,6 +231,21 @@ opal_filter "String" do
234
231
  fails "String#sub with pattern, replacement replaces \\\\\\+ with \\\\+"
235
232
  fails "String#sub with pattern, replacement replaces \\\\\1 with \\"
236
233
  fails "String#sub with pattern, replacement replaces \\\1 with \1"
234
+ fails "String#sub with pattern and Hash returns a copy of self with the first occurrence of pattern replaced with the value of the corresponding hash key"
235
+ fails "String#sub with pattern and Hash removes keys that don't correspond to matches"
236
+ fails "String#sub with pattern and Hash ignores non-String keys"
237
+ fails "String#sub with pattern and Hash uses a key's value only a single time"
238
+ fails "String#sub with pattern and Hash uses the hash's default value for missing keys"
239
+ fails "String#sub with pattern and Hash coerces the hash values with #to_s"
240
+ fails "String#sub with pattern and Hash uses the hash's value set from default_proc for missing keys"
241
+ fails "String#sub with pattern and Hash sets $~ to MatchData of first match and nil when there's none for access from outside"
242
+ fails "String#sub with pattern and Hash doesn't interpolate special sequences like \\1 for the block's return value"
243
+ fails "String#sub with pattern and Hash untrusts the result if the original string is untrusted"
244
+ fails "String#sub with pattern and Hash untrusts the result if a hash value is untrusted"
245
+ fails "String#sub with pattern and Hash taints the result if the original string is tainted"
246
+ fails "String#sub with pattern and Hash taints the result if a hash value is tainted"
247
+
248
+
237
249
 
238
250
  fails "String#casecmp independent of case for non-ASCII characters returns -1 when numerically less than other"
239
251
  fails "String#casecmp independent of case for non-ASCII characters returns 1 when numerically greater than other"
@@ -303,6 +315,21 @@ opal_filter "String" do
303
315
  fails "String#initialize with no arguments does not raise an exception when frozen"
304
316
  fails "String#initialize is a private method"
305
317
 
318
+ fails "String#upto passes successive values, starting at self and ending at other_string, to the block"
319
+ fails "String#upto calls the block once even when start eqals stop"
320
+ fails "String#upto doesn't call block with self even if self is less than stop but stop length is less than self length"
321
+ fails "String#upto doesn't call block if stop is less than self and stop length is less than self length"
322
+ fails "String#upto doesn't call the block if self is greater than stop"
323
+ fails "String#upto stops iterating as soon as the current value's character count gets higher than stop's"
324
+ fails "String#upto returns self"
325
+ fails "String#upto tries to convert other to string using to_str"
326
+ fails "String#upto raises a TypeError if other can't be converted to a string"
327
+ fails "String#upto does not work with symbols"
328
+ fails "String#upto returns an enumerator when no block given"
329
+ fails "String#upto returns non-alphabetic characters in the ASCII range for single letters"
330
+ fails "String#upto stops before the last value if exclusive"
331
+ fails "String#upto on sequence of numbers calls the block as Integer#upto"
332
+
306
333
  fails "String#* always taints the result when self is tainted"
307
334
  fails "String#* returns subclass instances"
308
335
  fails "String#* raises a RangeError when given integer is a Bignum"
@@ -331,7 +358,7 @@ opal_filter "String" do
331
358
  fails "String#+ when self and the argument are in different ASCII-compatible encodings raises Encoding::CompatibilityError if neither are ASCII-only"
332
359
  fails "String#+ when self is ASCII-8BIT and argument is US-ASCII uses ASCII-8BIT encoding"
333
360
 
334
- fails "String#rpartition with String raises error if not convertible to string"
361
+ fails "String#rpartition with String raises an error if not convertible to string"
335
362
  fails "String#rpartition with String converts its argument using :to_str"
336
363
  fails "String#rpartition with String affects $~"
337
364
  fails "String#rpartition with String accepts regexp"
@@ -2,6 +2,7 @@ opal_filter "StringScanner" do
2
2
  fails "StringScanner#[] calls to_int on the given index"
3
3
  fails "StringScanner#[] raises a TypeError if the given index is nil"
4
4
  fails "StringScanner#[] raises a TypeError when a Range is as argument"
5
+ fails "StringScanner#[] raises a TypeError when a String is as argument"
5
6
 
6
7
  fails "StringScanner#get_byte is not multi-byte character sensitive"
7
8
 
@@ -1,19 +1,24 @@
1
1
  opal_filter "Struct" do
2
+ fails "Struct includes Enumerable"
3
+ fails "Struct anonymous class instance methods includes Enumerable"
4
+
2
5
  fails "Struct#[] fails when it does not know about the requested attribute"
3
6
  fails "Struct#[] fails if not passed a string, symbol, or integer"
4
7
 
5
8
  fails "Struct#[]= fails when trying to assign attributes which don't exist"
6
9
 
7
10
  fails "Struct#== returns true if the other has all the same fields"
8
- fails "Struct#== handles recursive structures by returning false if a difference can be found "
11
+ fails "Struct#== handles recursive structures by returning false if a difference can be found"
9
12
 
10
13
  fails "Struct#eql? returns false if any corresponding elements are not #eql?"
11
- fails "Struct#eql? handles recursive structures by returning false if a difference can be found "
14
+ fails "Struct#eql? handles recursive structures by returning false if a difference can be found"
12
15
 
13
16
  fails "Struct#hash returns the same fixnum for structs with the same content"
14
17
  fails "Struct#hash returns the same value if structs are #eql?"
15
18
  fails "Struct#hash returns the same hash for recursive structs"
16
19
 
20
+ fails "Struct#members does not override the instance accessor method"
21
+
17
22
  fails "Struct#to_h returns a Hash with members as keys"
18
23
  fails "Struct#to_h returns a Hash that is independent from the struct"
19
24
 
File without changes
@@ -18,6 +18,8 @@ opal_filter "Time" do
18
18
  fails "Time.at passed Numeric returns a Time object representing the given number of Float seconds since 1970-01-01 00:00:00 UTC"
19
19
  fails "Time.at passed Numeric returns a Time object representing the given number of Integer seconds since 1970-01-01 00:00:00 UTC"
20
20
 
21
+ fails "Time#day returns the day of the month for a UTC Time"
22
+
21
23
  fails "Time#getgm returns a new time which is the utc representation of time"
22
24
 
23
25
  fails "Time.gm ignores fractional seconds if a passed fractional number of microseconds"
@@ -27,6 +29,7 @@ opal_filter "Time" do
27
29
  fails "Time.gm handles microseconds"
28
30
  fails "Time.gm handles float arguments"
29
31
  fails "Time.gm handles string arguments"
32
+ fails "Time.gm handles years from 0 as such"
30
33
  fails "Time.gm returns subclass instances"
31
34
  fails "Time.gm raises ArgumentError when given 11 arguments"
32
35
  fails "Time.gm raises ArgumentError when given 9 arguments"
@@ -52,6 +55,12 @@ opal_filter "Time" do
52
55
  fails "Time#gmt_offset returns the correct offset for US Eastern time zone around daylight savings time change"
53
56
  fails "Time#gmt_offset returns the offset in seconds between the timezone of time and UTC"
54
57
 
58
+ fails "Time#hour returns the hour of the day for a UTC Time"
59
+
60
+ fails "Time#inspect formats the local time following the pattern 'yyyy-MM-dd HH:mm:ss Z'"
61
+ fails "Time#inspect formats the UTC time following the pattern 'yyyy-MM-dd HH:mm:ss UTC'"
62
+ fails "Time#inspect formats the fixed offset time following the pattern 'yyyy-MM-dd HH:mm:ss +/-HHMM'"
63
+
55
64
  fails "Time.local ignores fractional seconds if a passed fractional number of microseconds"
56
65
  fails "Time.local ignores fractional seconds if a passed whole number of microseconds"
57
66
  fails "Time.local handles fractional microseconds as a Rational"
@@ -62,6 +71,7 @@ opal_filter "Time" do
62
71
  fails "Time.local handles fractional seconds as a Float"
63
72
  fails "Time.local coerces the month with #to_str"
64
73
  fails "Time.local handles a String month given as a short month name"
74
+ fails "Time.local handles years from 0 as such"
65
75
  fails "Time.local creates the correct time just after dst change"
66
76
  fails "Time.local creates the correct time just before dst change"
67
77
  fails "Time.local creates a time based on given C-style gmtime arguments, interpreted in the local time zone"
@@ -79,12 +89,19 @@ opal_filter "Time" do
79
89
  fails "Time#- accepts arguments that can be coerced into Rational"
80
90
  fails "Time#- understands negative subtractions"
81
91
 
92
+ fails "Time#mday returns the day of the month for a UTC Time"
93
+
94
+ fails "Time#mon returns the month of the year for a UTC Time"
95
+
96
+ fails "Time#month returns the month of the year for a UTC Time"
97
+
82
98
  fails "Time.mktime respects rare old timezones"
83
99
  fails "Time.mktime creates a time based on given values, interpreted in the local time zone"
84
100
  fails "Time.mktime creates the correct time just before dst change"
85
101
  fails "Time.mktime creates the correct time just after dst change"
86
102
  fails "Time.mktime handles fractional seconds as a Rational"
87
103
  fails "Time.mktime handles fractional seconds as a Float"
104
+ fails "Time.mktime handles years from 0 as such"
88
105
  fails "Time.mktime creates a time based on given C-style gmtime arguments, interpreted in the local time zone"
89
106
  fails "Time.mktime coerces the month with #to_str"
90
107
  fails "Time.mktime handles a String day"
@@ -113,6 +130,7 @@ opal_filter "Time" do
113
130
 
114
131
  fails "Time#to_s formats the local time following the pattern 'yyyy-MM-dd HH:mm:ss Z'"
115
132
  fails "Time#to_s formats the fixed offset time following the pattern 'yyyy-MM-dd HH:mm:ss +/-HHMM'"
133
+ fails "Time#to_s formats the UTC time following the pattern 'yyyy-MM-dd HH:mm:ss UTC'"
116
134
 
117
135
  fails "Time#utc returns the utc representation of time"
118
136
  fails "Time.utc ignores fractional seconds if a passed fractional number of microseconds"
@@ -127,6 +145,7 @@ opal_filter "Time" do
127
145
  fails "Time.utc raises ArgumentError when given 9 arguments"
128
146
  fails "Time.utc handles fractional seconds as a Rational"
129
147
  fails "Time.utc handles fractional seconds as a Float"
148
+ fails "Time.utc handles years from 0 as such"
130
149
  fails "Time.utc coerces the second with #to_int"
131
150
  fails "Time.utc coerces the minute with #to_int"
132
151
  fails "Time.utc coerces the hour with #to_int"
@@ -146,4 +165,8 @@ opal_filter "Time" do
146
165
  fails "Time#utc_offset returns the correct offset for Hawaii around daylight savings time change"
147
166
  fails "Time#utc_offset returns the correct offset for US Eastern time zone around daylight savings time change"
148
167
  fails "Time#utc_offset returns the offset in seconds between the timezone of time and UTC"
168
+
169
+ fails "Time#wday returns an integer representing the day of the week, 0..6, with Sunday being 0"
170
+
171
+ fails "Time#year returns the four digit year for a UTC Time as an Integer"
149
172
  end