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.
Files changed (193) hide show
  1. checksums.yaml +4 -4
  2. data/.gitattributes +1 -0
  3. data/.gitignore +2 -3
  4. data/.gitmodules +5 -2
  5. data/.jshintrc +1 -8
  6. data/.rspec +1 -1
  7. data/.travis.yml +15 -23
  8. data/CHANGELOG.md +511 -326
  9. data/CODE_OF_CONDUCT.md +13 -15
  10. data/CONTRIBUTING.md +26 -216
  11. data/Gemfile +20 -12
  12. data/Guardfile +2 -2
  13. data/HACKING.md +230 -0
  14. data/README.md +6 -7
  15. data/bin/opal-mspec +1 -1
  16. data/config.ru +2 -2
  17. data/docs/faq.md +1 -1
  18. data/docs/source_maps.md +1 -1
  19. data/lib/opal.rb +1 -0
  20. data/lib/opal/builder.rb +1 -1
  21. data/lib/opal/cli.rb +30 -28
  22. data/lib/opal/cli_options.rb +3 -0
  23. data/lib/opal/cli_runners.rb +14 -1
  24. data/lib/opal/cli_runners/{apple_script.rb → applescript.rb} +3 -3
  25. data/lib/opal/cli_runners/nashorn.rb +2 -2
  26. data/lib/opal/cli_runners/nodejs.rb +2 -2
  27. data/lib/opal/cli_runners/phantom.js +24 -0
  28. data/lib/opal/cli_runners/phantomjs.rb +10 -10
  29. data/lib/opal/cli_runners/server.rb +3 -3
  30. data/lib/opal/compiler.rb +43 -4
  31. data/lib/opal/config.rb +3 -1
  32. data/lib/opal/errors.rb +13 -0
  33. data/lib/opal/fragment.rb +0 -13
  34. data/lib/opal/nodes.rb +10 -0
  35. data/lib/opal/nodes/args/initialize_kwargs.rb +28 -0
  36. data/lib/opal/nodes/args/kwarg.rb +29 -0
  37. data/lib/opal/nodes/args/kwoptarg.rb +29 -0
  38. data/lib/opal/nodes/args/kwrestarg.rb +39 -0
  39. data/lib/opal/nodes/args/mlhsarg.rb +79 -0
  40. data/lib/opal/nodes/args/normarg.rb +26 -0
  41. data/lib/opal/nodes/args/optarg.rb +27 -0
  42. data/lib/opal/nodes/args/post_args.rb +200 -0
  43. data/lib/opal/nodes/args/post_kwargs.rb +31 -0
  44. data/lib/opal/nodes/args/restarg.rb +33 -0
  45. data/lib/opal/nodes/base.rb +12 -0
  46. data/lib/opal/nodes/call.rb +92 -33
  47. data/lib/opal/nodes/def.rb +26 -169
  48. data/lib/opal/nodes/hash.rb +10 -4
  49. data/lib/opal/nodes/helpers.rb +6 -3
  50. data/lib/opal/nodes/inline_args.rb +61 -0
  51. data/lib/opal/nodes/iter.rb +73 -82
  52. data/lib/opal/nodes/logic.rb +12 -2
  53. data/lib/opal/nodes/masgn.rb +1 -2
  54. data/lib/opal/nodes/node_with_args.rb +141 -0
  55. data/lib/opal/nodes/rescue.rb +121 -43
  56. data/lib/opal/nodes/scope.rb +24 -5
  57. data/lib/opal/nodes/super.rb +122 -54
  58. data/lib/opal/nodes/top.rb +0 -12
  59. data/lib/opal/nodes/yield.rb +2 -13
  60. data/lib/opal/parser.rb +67 -39
  61. data/lib/opal/parser/grammar.rb +3319 -2961
  62. data/lib/opal/parser/grammar.y +234 -46
  63. data/lib/opal/parser/lexer.rb +105 -17
  64. data/lib/opal/parser/sexp.rb +4 -0
  65. data/lib/opal/paths.rb +4 -0
  66. data/lib/opal/regexp_anchors.rb +19 -1
  67. data/lib/opal/sprockets.rb +21 -18
  68. data/lib/opal/sprockets/environment.rb +0 -8
  69. data/lib/opal/sprockets/processor.rb +13 -16
  70. data/lib/opal/sprockets/server.rb +6 -12
  71. data/lib/opal/version.rb +1 -1
  72. data/opal.gemspec +1 -0
  73. data/opal/corelib/array.rb +209 -131
  74. data/opal/corelib/basic_object.rb +7 -3
  75. data/opal/corelib/class.rb +11 -17
  76. data/opal/corelib/constants.rb +2 -2
  77. data/opal/corelib/enumerable.rb +178 -355
  78. data/opal/corelib/enumerator.rb +3 -46
  79. data/opal/corelib/error.rb +2 -2
  80. data/opal/corelib/file.rb +13 -1
  81. data/opal/corelib/hash.rb +26 -56
  82. data/opal/corelib/helpers.rb +10 -0
  83. data/opal/corelib/kernel.rb +6 -3
  84. data/opal/corelib/module.rb +62 -31
  85. data/opal/corelib/number.rb +7 -16
  86. data/opal/corelib/proc.rb +24 -9
  87. data/opal/corelib/range.rb +4 -13
  88. data/opal/corelib/runtime.js +515 -378
  89. data/opal/corelib/string.rb +21 -49
  90. data/opal/corelib/struct.rb +50 -35
  91. data/opal/corelib/unsupported.rb +18 -30
  92. data/opal/opal.rb +0 -1
  93. data/opal/opal/mini.rb +1 -0
  94. data/spec/README.md +6 -4
  95. data/spec/filters/bugs/array.rb +0 -42
  96. data/spec/filters/bugs/basicobject.rb +0 -2
  97. data/spec/filters/bugs/bigdecimal.rb +160 -0
  98. data/spec/filters/bugs/class.rb +0 -5
  99. data/spec/filters/bugs/date.rb +1 -48
  100. data/spec/filters/bugs/enumerable.rb +4 -12
  101. data/spec/filters/bugs/enumerator.rb +0 -1
  102. data/spec/filters/bugs/exception.rb +4 -3
  103. data/spec/filters/bugs/float.rb +4 -2
  104. data/spec/filters/bugs/kernel.rb +25 -10
  105. data/spec/filters/bugs/language.rb +119 -68
  106. data/spec/filters/bugs/method.rb +135 -0
  107. data/spec/filters/bugs/module.rb +13 -28
  108. data/spec/filters/bugs/proc.rb +18 -8
  109. data/spec/filters/bugs/range.rb +0 -3
  110. data/spec/filters/bugs/rational.rb +4 -0
  111. data/spec/filters/bugs/regexp.rb +68 -36
  112. data/spec/filters/bugs/string.rb +1 -1
  113. data/spec/filters/bugs/struct.rb +0 -12
  114. data/spec/filters/bugs/time.rb +1 -0
  115. data/spec/filters/bugs/unboundmethod.rb +2 -1
  116. data/spec/filters/unsupported/freeze.rb +3 -1
  117. data/spec/filters/unsupported/language.rb +0 -7
  118. data/spec/filters/unsupported/privacy.rb +7 -6
  119. data/spec/filters/unsupported/string.rb +10 -0
  120. data/spec/filters/unsupported/struct.rb +3 -0
  121. data/spec/filters/unsupported/symbol.rb +9 -0
  122. data/spec/filters/unsupported/taint.rb +0 -3
  123. data/spec/filters/unsupported/thread.rb +1 -0
  124. data/spec/lib/cli_runners/phantomjs_spec.rb +39 -0
  125. data/spec/lib/cli_spec.rb +42 -1
  126. data/spec/lib/compiler/call_spec.rb +700 -0
  127. data/spec/lib/compiler_spec.rb +46 -28
  128. data/spec/lib/config_spec.rb +13 -0
  129. data/spec/lib/parser/call_spec.rb +18 -0
  130. data/spec/lib/parser/def_spec.rb +29 -0
  131. data/spec/lib/parser/iter_spec.rb +15 -15
  132. data/spec/lib/parser/lambda_spec.rb +153 -12
  133. data/spec/lib/parser/string_spec.rb +5 -0
  134. data/spec/lib/parser/undef_spec.rb +1 -1
  135. data/spec/lib/parser/variables_spec.rb +24 -0
  136. data/spec/lib/paths_spec.rb +12 -5
  137. data/spec/lib/spec_helper.rb +5 -0
  138. data/spec/lib/sprockets/processor_spec.rb +6 -5
  139. data/spec/lib/sprockets_spec.rb +8 -0
  140. data/spec/mspec-opal/formatters.rb +188 -0
  141. data/spec/mspec-opal/runner.rb +193 -0
  142. data/spec/opal/core/enumerator/with_index_spec.rb +6 -0
  143. data/spec/opal/core/kernel/define_singleton_method_spec.rb +1 -1
  144. data/spec/opal/core/kernel/instance_variables_spec.rb +14 -0
  145. data/spec/opal/core/kernel/loop_spec.rb +1 -1
  146. data/spec/opal/core/kernel/raise_spec.rb +1 -1
  147. data/spec/opal/core/language/heredoc_spec.rb +42 -0
  148. data/spec/opal/core/language/rescue_spec.rb +18 -0
  149. data/spec/opal/core/language_spec.rb +22 -0
  150. data/spec/opal/core/module/const_defined_spec.rb +1 -2
  151. data/spec/opal/core/module/name_spec.rb +6 -0
  152. data/spec/opal/core/runtime/bridged_classes_spec.rb +14 -2
  153. data/spec/opal/core/runtime/rescue_spec.rb +12 -2
  154. data/spec/opal/core/runtime/super_spec.rb +1 -0
  155. data/spec/opal/core/string_spec.rb +21 -0
  156. data/spec/opal/stdlib/js_spec.rb +1 -1
  157. data/spec/opal/stdlib/native/hash_spec.rb +7 -0
  158. data/spec/opal/stdlib/promise/always_spec.rb +24 -5
  159. data/spec/opal/stdlib/promise/rescue_spec.rb +15 -6
  160. data/spec/opal/stdlib/promise/then_spec.rb +13 -5
  161. data/spec/opal/stdlib/promise/trace_spec.rb +5 -6
  162. data/spec/opal/stdlib/strscan/scan_spec.rb +1 -1
  163. data/spec/ruby_specs +122 -0
  164. data/spec/spec_helper.rb +3 -15
  165. data/stdlib/base64.rb +51 -121
  166. data/stdlib/bigdecimal.rb +231 -0
  167. data/stdlib/bigdecimal/bignumber.js.rb +11 -0
  168. data/stdlib/bigdecimal/kernel.rb +5 -0
  169. data/stdlib/date.rb +252 -10
  170. data/stdlib/native.rb +38 -38
  171. data/stdlib/nodejs/dir.rb +8 -6
  172. data/stdlib/nodejs/file.rb +28 -3
  173. data/stdlib/nodejs/node_modules/.bin/js-yaml +1 -0
  174. data/stdlib/nodejs/node_modules/js-yaml/node_modules/.bin/esparse +1 -0
  175. data/stdlib/nodejs/node_modules/js-yaml/node_modules/.bin/esvalidate +1 -0
  176. data/stdlib/nodejs/require.rb +1 -1
  177. data/stdlib/nodejs/yaml.rb +3 -2
  178. data/stdlib/opal-parser.rb +7 -2
  179. data/stdlib/pathname.rb +23 -1
  180. data/stdlib/phantomjs.rb +10 -0
  181. data/stdlib/promise.rb +38 -23
  182. data/tasks/building.rake +3 -3
  183. data/tasks/testing.rake +27 -14
  184. data/tasks/testing/mspec_special_calls.rb +1 -1
  185. data/tasks/testing/sprockets-phantomjs.js +4 -0
  186. data/test/opal/test_keyword.rb +110 -110
  187. data/test/opal/unsupported_and_bugs.rb +30 -0
  188. data/vendored-minitest/minitest/assertions.rb +1 -1
  189. metadata +65 -15
  190. data/.spectator +0 -2
  191. data/.spectator-mspec +0 -3
  192. data/opal/corelib/array/inheritance.rb +0 -127
  193. data/spec/rubyspecs +0 -139
@@ -1,8 +1,6 @@
1
1
  opal_filter "BasicObject" do
2
2
  fails "BasicObject does not define built-in constants (according to const_defined?)"
3
3
  fails "BasicObject does not define built-in constants (according to defined?)"
4
- fails "BasicObject metaclass contains methods for the BasicObject class"
5
- fails "BasicObject metaclass has Class as superclass"
6
4
  fails "BasicObject raises NameError when referencing built-in constants"
7
5
  fails "BasicObject raises NoMethodError for nonexistent methods after #method_missing is removed"
8
6
  fails "BasicObject#__send__ has a negative arity"
@@ -0,0 +1,160 @@
1
+ opal_filter "BigDecimal" do
2
+ fails "BigDecimal#% raises TypeError if the argument cannot be coerced to BigDecimal"
3
+ fails "BigDecimal#% returns NaN if NaN is involved"
4
+ fails "BigDecimal#% returns NaN if the dividend is Infinity"
5
+ fails "BigDecimal#% returns a [Float value] when the argument is Float"
6
+ fails "BigDecimal#% returns self modulo other"
7
+ fails "BigDecimal#% returns the dividend if the divisor is Infinity"
8
+ fails "BigDecimal#** 0 to power of 0 is 1"
9
+ fails "BigDecimal#** 0 to powers < 0 is Infinity"
10
+ fails "BigDecimal#** other powers of 0 are 0"
11
+ fails "BigDecimal#** powers of 1 equal 1"
12
+ fails "BigDecimal#** powers of self"
13
+ fails "BigDecimal#** returns 0.0 if self is infinite and argument is negative"
14
+ fails "BigDecimal#** returns NaN if self is NaN"
15
+ fails "BigDecimal#** returns infinite if self is infinite and argument is positive"
16
+ fails "BigDecimal#-@ properly handles special values"
17
+ fails "BigDecimal#/ returns a / b" #fails a single assertion: @one.send(@method, BigDecimal('-2E5555'), *@object).should == BigDecimal('-0.5E-5555')
18
+ fails "BigDecimal#< properly handles infinity values" #fails only with mock object
19
+ fails "BigDecimal#<= properly handles infinity values" #fails only with mock object
20
+ fails "BigDecimal#<=> returns -1 if a < b" #fails only with mock object
21
+ fails "BigDecimal#<=> returns 1 if a > b" #fails only with mock object
22
+ fails "BigDecimal#> properly handles infinity values" #fails only with mock object
23
+ fails "BigDecimal#>= properly handles infinity values" #fails only with mock object
24
+ fails "BigDecimal#ceil returns n digits right of the decimal point if given n > 0"
25
+ fails "BigDecimal#ceil returns the smallest integer greater or equal to self, if n is unspecified"
26
+ fails "BigDecimal#ceil sets n digits left of the decimal point to 0, if given n < 0"
27
+ fails "BigDecimal#coerce returns [other, self] both as BigDecimal"
28
+ fails "BigDecimal#div returns a / b with optional precision" #fails the case of > 20 decimal places for to_s('F')
29
+ fails "BigDecimal#div with precision set to 0 returns a / b" #fails a single assertion: @one.send(@method, BigDecimal('-2E5555'), *@object).should == BigDecimal('-0.5E-5555')
30
+ fails "BigDecimal#divmod Can be reversed with * and +"
31
+ fails "BigDecimal#divmod array contains quotient and modulus as BigDecimal"
32
+ fails "BigDecimal#divmod divides value, returns an array"
33
+ fails "BigDecimal#divmod raises TypeError if the argument cannot be coerced to BigDecimal"
34
+ fails "BigDecimal#divmod returns an array of Infinity and NaN if the dividend is Infinity"
35
+ fails "BigDecimal#divmod returns an array of two NaNs if NaN is involved"
36
+ fails "BigDecimal#divmod returns an array of zero and the dividend if the divisor is Infinity"
37
+ fails "BigDecimal#exponent is n if number can be represented as 0.xxx*10**n"
38
+ fails "BigDecimal#exponent returns 0 if self is 0"
39
+ fails "BigDecimal#exponent returns an Integer"
40
+ fails "BigDecimal#fix correctly handles special values"
41
+ fails "BigDecimal#fix does not allow any arguments"
42
+ fails "BigDecimal#fix returns 0 if the absolute value is < 1"
43
+ fails "BigDecimal#fix returns a BigDecimal"
44
+ fails "BigDecimal#fix returns the integer part of the absolute value"
45
+ fails "BigDecimal#floor raise exception, if self is special value"
46
+ fails "BigDecimal#floor returns n digits right of the decimal point if given n > 0"
47
+ fails "BigDecimal#floor returns the greatest integer smaller or equal to self"
48
+ fails "BigDecimal#floor sets n digits left of the decimal point to 0, if given n < 0"
49
+ fails "BigDecimal#frac correctly handles special values"
50
+ fails "BigDecimal#frac returns 0 if the value is 0"
51
+ fails "BigDecimal#frac returns 0 if the value is an integer"
52
+ fails "BigDecimal#frac returns a BigDecimal"
53
+ fails "BigDecimal#frac returns the fractional part of the absolute value"
54
+ fails "BigDecimal#inspect encloses information in angle brackets"
55
+ fails "BigDecimal#inspect is comma separated list of three items"
56
+ fails "BigDecimal#inspect last part is number of significant digits"
57
+ fails "BigDecimal#inspect looks like this"
58
+ fails "BigDecimal#inspect returns String starting with #"
59
+ fails "BigDecimal#inspect value after first comma is value as string"
60
+ fails "BigDecimal#mod_part_of_divmod raises TypeError if the argument cannot be coerced to BigDecimal"
61
+ fails "BigDecimal#mod_part_of_divmod returns NaN if NaN is involved"
62
+ fails "BigDecimal#mod_part_of_divmod returns NaN if the dividend is Infinity"
63
+ fails "BigDecimal#mod_part_of_divmod returns a [Float value] when the argument is Float"
64
+ fails "BigDecimal#mod_part_of_divmod returns self modulo other"
65
+ fails "BigDecimal#mod_part_of_divmod returns the dividend if the divisor is Infinity"
66
+ fails "BigDecimal#modulo raises TypeError if the argument cannot be coerced to BigDecimal"
67
+ fails "BigDecimal#modulo returns NaN if NaN is involved"
68
+ fails "BigDecimal#modulo returns NaN if the dividend is Infinity"
69
+ fails "BigDecimal#modulo returns a [Float value] when the argument is Float"
70
+ fails "BigDecimal#modulo returns self modulo other"
71
+ fails "BigDecimal#modulo returns the dividend if the divisor is Infinity"
72
+ fails "BigDecimal#power 0 to power of 0 is 1"
73
+ fails "BigDecimal#power 0 to powers < 0 is Infinity"
74
+ fails "BigDecimal#power other powers of 0 are 0"
75
+ fails "BigDecimal#power powers of 1 equal 1"
76
+ fails "BigDecimal#power powers of self"
77
+ fails "BigDecimal#power returns 0.0 if self is infinite and argument is negative"
78
+ fails "BigDecimal#power returns NaN if self is NaN"
79
+ fails "BigDecimal#power returns infinite if self is infinite and argument is positive"
80
+ fails "BigDecimal#precs returns Integers as array values"
81
+ fails "BigDecimal#precs returns array of two values"
82
+ fails "BigDecimal#precs returns the current value of significant digits as the first value"
83
+ fails "BigDecimal#precs returns the maximum number of significant digits as the second value"
84
+ fails "BigDecimal#quo returns a / b" #fails a single assertion: @one.send(@method, BigDecimal('-2E5555'), *@object).should == BigDecimal('-0.5E-5555')
85
+ fails "BigDecimal#remainder coerces arguments to BigDecimal if possible"
86
+ fails "BigDecimal#remainder it equals modulo, if both values are of same sign"
87
+ fails "BigDecimal#remainder means self-arg*(self/arg).truncate"
88
+ fails "BigDecimal#remainder raises TypeError if the argument cannot be coerced to BigDecimal"
89
+ fails "BigDecimal#remainder returns NaN if Infinity is involved"
90
+ fails "BigDecimal#remainder returns NaN if NaN is involved"
91
+ fails "BigDecimal#remainder returns NaN used with zero"
92
+ fails "BigDecimal#remainder returns zero if used on zero"
93
+ fails "BigDecimal#round BigDecimal::ROUND_CEILING rounds values towards +infinity"
94
+ fails "BigDecimal#round BigDecimal::ROUND_DOWN rounds values towards zero"
95
+ fails "BigDecimal#round BigDecimal::ROUND_FLOOR rounds values towards -infinity"
96
+ fails "BigDecimal#round BigDecimal::ROUND_HALF_DOWN rounds values > 5 up, otherwise down"
97
+ fails "BigDecimal#round BigDecimal::ROUND_HALF_EVEN rounds values > 5 up, < 5 down and == 5 towards even neighbor"
98
+ fails "BigDecimal#round BigDecimal::ROUND_HALF_UP rounds values >= 5 up, otherwise down"
99
+ fails "BigDecimal#round BigDecimal::ROUND_UP rounds values away from zero"
100
+ fails "BigDecimal#round uses default rounding method unless given"
101
+ fails "BigDecimal#sign returns negative value if BigDecimal less than 0"
102
+ fails "BigDecimal#sign returns positive value if BigDecimal greater than 0"
103
+ fails "BigDecimal#split First value: -1 for numbers < 0"
104
+ fails "BigDecimal#split First value: 0 if BigDecimal is NaN"
105
+ fails "BigDecimal#split First value: 1 for numbers > 0"
106
+ fails "BigDecimal#split Fourth value: The exponent"
107
+ fails "BigDecimal#split Second value: a string with the significant digits"
108
+ fails "BigDecimal#split Third value: the base (currently always ten)"
109
+ fails "BigDecimal#split splits BigDecimal in an array with four values"
110
+ fails "BigDecimal#sqrt raises ArgumentError if 2 arguments are given"
111
+ fails "BigDecimal#sqrt raises ArgumentError if a negative number is given"
112
+ fails "BigDecimal#sqrt raises ArgumentError when no argument is given"
113
+ fails "BigDecimal#sqrt raises FloatDomainError for NaN"
114
+ fails "BigDecimal#sqrt raises FloatDomainError for negative infinity"
115
+ fails "BigDecimal#sqrt raises FloatDomainError on negative values"
116
+ fails "BigDecimal#sqrt raises TypeError if a plain Object is given"
117
+ fails "BigDecimal#sqrt raises TypeError if a string is given"
118
+ fails "BigDecimal#sqrt raises TypeError if nil is given"
119
+ fails "BigDecimal#sqrt returns 0 for 0, +0.0 and -0.0"
120
+ fails "BigDecimal#sqrt returns 1 if precision is 0 or 1"
121
+ fails "BigDecimal#sqrt returns positive infitinity for infinity"
122
+ fails "BigDecimal#sqrt returns square root of 0.9E-99999 with desired precision"
123
+ fails "BigDecimal#sqrt returns square root of 121 with desired precision"
124
+ fails "BigDecimal#sqrt returns square root of 2 with desired precision"
125
+ fails "BigDecimal#sqrt returns square root of 3 with desired precision"
126
+ fails "BigDecimal#to_f properly handles special values"
127
+ fails "BigDecimal#to_f remembers negative zero when converted to float"
128
+ fails "BigDecimal#to_i raises FloatDomainError if BigDecimal is infinity or NaN"
129
+ fails "BigDecimal#to_i returns Integer or Bignum otherwise"
130
+ fails "BigDecimal#to_int raises FloatDomainError if BigDecimal is infinity or NaN"
131
+ fails "BigDecimal#to_int returns Integer or Bignum otherwise"
132
+ fails "BigDecimal#to_s can return a leading space for values > 0"
133
+ fails "BigDecimal#to_s can use conventional floating point notation"
134
+ fails "BigDecimal#to_s can use engineering notation"
135
+ fails "BigDecimal#to_s inserts a space every n chars, if integer n is supplied"
136
+ fails "BigDecimal#to_s removes trailing spaces in floating point notation"
137
+ fails "BigDecimal#to_s starts with + if + is supplied and value is positive"
138
+ fails "BigDecimal#to_s the default format looks like 0.xxxxEnn"
139
+ fails "BigDecimal#truncate returns Infinity if self is infinite"
140
+ fails "BigDecimal#truncate returns NaN if self is NaN"
141
+ fails "BigDecimal#truncate returns the same value if self is special value"
142
+ fails "BigDecimal#truncate returns value of given precision otherwise"
143
+ fails "BigDecimal#truncate sets n digits left of the decimal point to 0, if given n < 0"
144
+ fails "BigDecimal.double_fig returns the number of digits a Float number is allowed to have"
145
+ fails "BigDecimal.limit returns the value before set if the passed argument is nil or is not specified"
146
+ fails "BigDecimal.limit use the global limit if no precision is specified"
147
+ fails "BigDecimal.mode raise an exception if the flag is true"
148
+ fails "BigDecimal.mode returns Infinity when too big"
149
+ fails "BigDecimal.mode returns the appropriate value and continue the computation if the flag is false"
150
+ fails "BigDecimal.new Number of significant digits >= given precision"
151
+ fails "BigDecimal.new allows for [eEdD] as exponent separator"
152
+ fails "BigDecimal.new allows for underscores in all parts"
153
+ fails "BigDecimal.new creates a new object of class BigDecimal"
154
+ fails "BigDecimal.new determines precision from initial value"
155
+ fails "BigDecimal.new ignores leading whitespace"
156
+ fails "BigDecimal.new ignores trailing garbage"
157
+ fails "BigDecimal.new raises ArgumentError when Float is used without precision"
158
+ fails "BigDecimal.new treats invalid strings as 0.0"
159
+ fails "BigDecimal.ver returns the Version number"
160
+ end
@@ -1,15 +1,10 @@
1
1
  opal_filter "Class" do
2
2
  fails "Class#allocate raises TypeError for #superclass"
3
- fails "Class#allocate returns a fully-formed instance of Module"
4
3
  fails "Class#dup duplicates both the class and the singleton class"
5
4
  fails "Class#dup retains an included module in the ancestor chain for the singleton class"
6
5
  fails "Class#dup retains the correct ancestor chain for the singleton class"
7
- fails "Class#dup sets the name from the class to nil if not assigned to a constant"
8
- fails "Class#dup stores the new name if assigned to a constant"
9
6
  fails "Class#initialize raises a TypeError when called on already initialized classes"
10
7
  fails "Class#initialize raises a TypeError when called on BasicObject"
11
8
  fails "Class#initialize when given the Class raises a TypeError"
12
- fails "Class#new passes the block to #initialize"
13
- fails "Class#superclass for a singleton class of a class returns the singleton class of its superclass"
14
9
  fails "Class.new raises a TypeError if passed a metaclass"
15
10
  end
@@ -36,54 +36,7 @@ opal_filter "Date" do
36
36
  fails "Date#parse parses a day name into a Date object"
37
37
  fails "Date#parse parses a month day into a Date object"
38
38
  fails "Date#parse parses a month name into a Date object"
39
- fails "Date#parse parses DD as month day number"
40
- fails "Date#parse parses DDD as year day number"
41
- fails "Date#parse parses MMDD as month and day"
42
- fails "Date#parse parses YYDDD as year and day number in 1969--2068"
43
- fails "Date#parse parses YYMMDD as year, month and day in 1969--2068"
44
- fails "Date#parse parses YYYYDDD as year and day number"
45
- fails "Date#parse parses YYYYMMDD as year, month and day number"
46
- fails "Date#parse throws an argument error for a single digit"
47
- fails "Date#parse with '-' separator EU-style can parse a MM-DD-YY string into a Date object NOT using the year digits as 20XX"
48
- fails "Date#parse with '-' separator EU-style can parse a MM-DD-YY string into a Date object using the year digits as 20XX"
49
- fails "Date#parse with '-' separator EU-style can parse a MM-DD-YY string into a Date object"
50
- fails "Date#parse with '-' separator EU-style can parse a MM-DD-YYYY string into a Date object"
51
- fails "Date#parse with ' ' separator can handle negative year numbers"
52
- fails "Date#parse with ' ' separator can parse a 'DD mmm YYYY' string into a Date object"
53
- fails "Date#parse with ' ' separator can parse a 'mmm DD YYYY' string into a Date object"
54
- fails "Date#parse with ' ' separator can parse a 'YYYY mmm DD' string into a Date object"
55
- fails "Date#parse with ' ' separator can parse a mmm-YYYY string into a Date object"
56
- fails "Date#parse with ' ' separator can parse a month name and day into a Date object"
57
- fails "Date#parse with ' ' separator can parse a month name, day and year into a Date object"
58
- fails "Date#parse with ' ' separator can parse a year, day and month name into a Date object"
59
- fails "Date#parse with ' ' separator can parse a year, month name and day into a Date object"
60
- fails "Date#parse with '.' separator can handle negative year numbers"
61
- fails "Date#parse with '.' separator can parse a 'DD mmm YYYY' string into a Date object"
62
- fails "Date#parse with '.' separator can parse a 'mmm DD YYYY' string into a Date object"
63
- fails "Date#parse with '.' separator can parse a 'YYYY mmm DD' string into a Date object"
64
- fails "Date#parse with '.' separator can parse a mmm-YYYY string into a Date object"
65
- fails "Date#parse with '.' separator can parse a month name and day into a Date object"
66
- fails "Date#parse with '.' separator can parse a month name, day and year into a Date object"
67
- fails "Date#parse with '.' separator can parse a year, day and month name into a Date object"
68
- fails "Date#parse with '.' separator can parse a year, month name and day into a Date object"
69
- fails "Date#parse with '/' separator can handle negative year numbers"
70
- fails "Date#parse with '/' separator can parse a 'DD mmm YYYY' string into a Date object"
71
- fails "Date#parse with '/' separator can parse a 'mmm DD YYYY' string into a Date object"
72
- fails "Date#parse with '/' separator can parse a 'YYYY mmm DD' string into a Date object"
73
- fails "Date#parse with '/' separator can parse a mmm-YYYY string into a Date object"
74
- fails "Date#parse with '/' separator can parse a month name and day into a Date object"
75
- fails "Date#parse with '/' separator can parse a month name, day and year into a Date object"
76
- fails "Date#parse with '/' separator can parse a year, day and month name into a Date object"
77
- fails "Date#parse with '/' separator can parse a year, month name and day into a Date object"
78
- fails "Date#parse with '/' separator US-style parses a MMDDYY string into a Date object NOT using the year digits as 20XX"
79
- fails "Date#parse with '/' separator US-style parses a MMDDYY string into a Date object using the year digits as 20XX"
80
- fails "Date#parse with '/' separator US-style parses a MMDDYY string into a Date object"
81
- fails "Date#parse with '/' separator US-style parses a MMDDYYYY string into a Date object"
82
- fails "Date#parse with '/' separator US-style parses a YYYYMMDD string into a Date object"
83
- fails "Date#parse(.) parses DD.MM.YYYY into a Date object"
84
- fails "Date#parse(.) parses YY.MM.DD into a Date object using the year 20YY"
85
- fails "Date#parse(.) parses YY.MM.DD using the year digits as 20YY when given true as additional argument"
86
- fails "Date#parse(.) parses YYYY.MM.DD into a Date object"
39
+ fails "Date#parse parses DDD as year day number" # requires Date.gregorian_leap?
87
40
  fails "Date#prev_year returns the day of the reform if date falls within calendar reform"
88
41
  fails "Date#step steps backward in time"
89
42
  fails "Date#step steps forward in time"
@@ -1,14 +1,6 @@
1
1
  opal_filter "Enumerable" do
2
- fails "Enumerable#each_entry Enumerable with no size when no block is given returned Enumerator size returns nil"
3
- fails "Enumerable#each_entry Enumerable with size when no block is given returned Enumerator size returns the enumerable size"
4
- fails "Enumerable#each_entry passes extra arguments to #each"
5
- fails "Enumerable#each_entry passes through the values yielded by #each_with_index"
6
- fails "Enumerable#each_entry returns an enumerator if no block"
7
- fails "Enumerable#each_entry yields multiple arguments as an array"
8
- fails "Enumerable#max that is nil returns the maximum element"
9
- fails "Enumerable#max when called with an argument n on a enumerable of length x where x < n returns an array containing the maximum n elements of length x"
10
- fails "Enumerable#max when called with an argument n with a block returns an array containing the maximum n elements"
11
- fails "Enumerable#max when called with an argument n without a block returns an array containing the maximum n elements"
2
+ fails "Enumerable#first returns a gathered array from yield parameters"
3
+ fails "Enumerable#grep with a block calls the block with gathered array when yielded with multiple arguments"
12
4
  fails "Enumerable#max_by when called with an argument n when n is nil returns the maximum element"
13
5
  fails "Enumerable#max_by when called with an argument n with a block on a enumerable of length x where x < n returns an array containing the maximum n elements of length n"
14
6
  fails "Enumerable#max_by when called with an argument n with a block returns an array containing the maximum n elements based on the block's value"
@@ -41,8 +33,7 @@ opal_filter "Enumerable" do
41
33
  fails "Enumerable#slice_when when given a block returns an enumerator"
42
34
  fails "Enumerable#slice_when when given a block splits chunks between adjacent elements i and j where the block returns true"
43
35
  fails "Enumerable#slice_when when not given a block raises an ArgumentError"
44
- fails "Enumerable#sort compare values returned by block with 0"
45
- fails "Enumerable#sort raises an error if objects can't be compared"
36
+ fails "Enumerable#sort_by returns an array of elements when a block is supplied and #map returns an enumerable"
46
37
  fails "Enumerable#take_while calls the block with initial args when yielded with multiple arguments"
47
38
  fails "Enumerable#to_h calls #to_ary on contents"
48
39
  fails "Enumerable#to_h converts empty enumerable to empty hash"
@@ -54,4 +45,5 @@ opal_filter "Enumerable" do
54
45
  fails "Enumerable#zip converts arguments to enums using #to_enum"
55
46
  fails "Enumerable#zip gathers whole arrays as elements when each yields multiple"
56
47
  fails "Enumerable#zip passes each element of the result array to a block and return nil if a block is given"
48
+ fails "when an iterator method yields more than one value processes all yielded values"
57
49
  end
@@ -1,7 +1,6 @@
1
1
  opal_filter "Enumerator" do
2
2
  fails "Enumerator#each requires multiple arguments"
3
3
  fails "Enumerator#each_with_index raises an ArgumentError if passed extra arguments"
4
- fails "Enumerator#each_with_index returns the iterator's return value"
5
4
  fails "Enumerator#each_with_index returns the object being enumerated when given a block"
6
5
  fails "Enumerator#enum_for exposes multi-arg yields as an array"
7
6
  fails "Enumerator#feed can be called for each iteration"
@@ -1,7 +1,7 @@
1
1
  opal_filter "Exception" do
2
2
  fails "Errno::EAGAIN is the same class as Errno::EWOULDBLOCK if they represent the same errno value"
3
- fails "Errno::EINVAL.new accepts an optional custom message"
4
3
  fails "Errno::EINVAL.new accepts an optional custom message and location"
4
+ fails "Errno::EINVAL.new accepts an optional custom message"
5
5
  fails "Errno::EINVAL.new can be called with no arguments"
6
6
  fails "Errno::EMFILE can be subclassed"
7
7
  fails "Exception is a superclass of EncodingError"
@@ -28,13 +28,13 @@ opal_filter "Exception" do
28
28
  fails "Exception#set_backtrace accepts nil"
29
29
  fails "Exception#set_backtrace allows the user to set the backtrace from a rescued exception"
30
30
  fails "Exception#set_backtrace raises a TypeError when passed a Symbol"
31
- fails "Exception#set_backtrace raises a TypeError when the argument is a nested array"
32
31
  fails "Exception#set_backtrace raises a TypeError when the Array contains a Symbol"
32
+ fails "Exception#set_backtrace raises a TypeError when the argument is a nested array"
33
33
  fails "Exception#set_backtrace raises a TypeError when the array contains nil"
34
34
  fails "IOError is a superclass of EOFError"
35
+ fails "NameError#name returns a class variable name as a symbol"
35
36
  fails "NoMethodError#message for an protected method match /protected method/"
36
37
  fails "NoMethodError#message for private method match /private method/"
37
- fails "rescueing SignalException raises a SignalException when sent a signal"
38
38
  fails "SignalException.new raises an exception for an optional argument with a signal name"
39
39
  fails "SignalException.new raises an exception with an invalid signal name"
40
40
  fails "SignalException.new raises an exception with an invalid signal number"
@@ -55,4 +55,5 @@ opal_filter "Exception" do
55
55
  fails "SystemCallError.new requires at least one argument"
56
56
  fails "SystemCallError.new returns an arity of -1 for the initialize method"
57
57
  fails "SystemStackError is a subclass of Exception"
58
+ fails "rescueing SignalException raises a SignalException when sent a signal"
58
59
  end
@@ -1,14 +1,16 @@
1
1
  opal_filter "Float" do
2
+ fails "Float constant MAX is 1.7976931348623157e+308"
3
+ fails "Float constant MIN is 2.2250738585072014e-308"
2
4
  fails "Float#divmod returns an [quotient, modulus] from dividing self by other" # precision errors caused by Math.frexp and Math.ldexp
3
- fails "Float#next_float returns a float the smallest possible step greater than the receiver"
4
5
  fails "Float#next_float returns NAN if NAN was the receiver"
6
+ fails "Float#next_float returns a float the smallest possible step greater than the receiver"
5
7
  fails "Float#next_float returns negative zero when stepping upward from just below zero"
6
8
  fails "Float#next_float reverses the effect of prev_float"
7
9
  fails "Float#next_float steps directly between -1.0 and -1.0 + EPSILON/2"
8
10
  fails "Float#next_float steps directly between 1.0 and 1.0 + EPSILON"
9
11
  fails "Float#next_float steps directly between MAX and INFINITY"
10
- fails "Float#prev_float returns a float the smallest possible step smaller than the receiver"
11
12
  fails "Float#prev_float returns NAN if NAN was the receiver"
13
+ fails "Float#prev_float returns a float the smallest possible step smaller than the receiver"
12
14
  fails "Float#prev_float returns positive zero when stepping downward from just above zero"
13
15
  fails "Float#prev_float reverses the effect of next_float"
14
16
  fails "Float#prev_float steps directly between -1.0 and -1.0 - EPSILON"
@@ -1,6 +1,17 @@
1
1
  opal_filter "Kernel" do
2
2
  fails "Kernel#=~ returns nil matching any object"
3
- fails "Kernel#Array does not call #to_a on an Array"
3
+ fails "Kernel#Float for hexadecimal literals with binary exponent allows embedded _ in a number on either side of the P"
4
+ fails "Kernel#Float for hexadecimal literals with binary exponent allows embedded _ in a number on either side of the p"
5
+ fails "Kernel#Float for hexadecimal literals with binary exponent allows hexadecimal points on the left side of the 'P'"
6
+ fails "Kernel#Float for hexadecimal literals with binary exponent allows hexadecimal points on the left side of the 'p'"
7
+ fails "Kernel#Float for hexadecimal literals with binary exponent interprets the exponent (on the right of 'P') in decimal"
8
+ fails "Kernel#Float for hexadecimal literals with binary exponent interprets the exponent (on the right of 'p') in decimal"
9
+ fails "Kernel#Float for hexadecimal literals with binary exponent interprets the fractional part (on the left side of 'P') in hexadecimal"
10
+ fails "Kernel#Float for hexadecimal literals with binary exponent interprets the fractional part (on the left side of 'p') in hexadecimal"
11
+ fails "Kernel#Float for hexadecimal literals with binary exponent returns 0 for '0x1P-10000'"
12
+ fails "Kernel#Float for hexadecimal literals with binary exponent returns 0 for '0x1p-10000'"
13
+ fails "Kernel#Float for hexadecimal literals with binary exponent returns Infinity for '0x1P10000'"
14
+ fails "Kernel#Float for hexadecimal literals with binary exponent returns Infinity for '0x1p10000'"
4
15
  fails "Kernel#String calls #to_s if #respond_to?(:to_s) returns true"
5
16
  fails "Kernel#String raises a TypeError if #to_s does not exist"
6
17
  fails "Kernel#String raises a TypeError if #to_s is not defined, even though #respond_to?(:to_s) returns true"
@@ -14,13 +25,11 @@ opal_filter "Kernel" do
14
25
  fails "Kernel#eval allows a binding to be captured inside an eval"
15
26
  fails "Kernel#eval allows creating a new class in a binding created by #eval"
16
27
  fails "Kernel#eval allows creating a new class in a binding"
17
- fails "Kernel#eval coerces an object to string"
28
+ fails "Kernel#eval can be aliased"
18
29
  fails "Kernel#eval does not alter the value of __FILE__ in the binding"
19
30
  fails "Kernel#eval does not make Proc locals visible to evaluated code"
20
31
  fails "Kernel#eval does not share locals across eval scopes"
21
32
  fails "Kernel#eval doesn't accept a Proc object as a binding"
22
- fails "Kernel#eval evaluates such that consts are scoped to the class of the eval"
23
- fails "Kernel#eval evaluates within the scope of the eval"
24
33
  fails "Kernel#eval finds a local in an enclosing scope"
25
34
  fails "Kernel#eval finds locals in a nested eval"
26
35
  fails "Kernel#eval includes file and line information in syntax error"
@@ -32,11 +41,9 @@ opal_filter "Kernel" do
32
41
  fails "Kernel#eval updates a local in a surrounding block scope"
33
42
  fails "Kernel#eval updates a local in an enclosing scope"
34
43
  fails "Kernel#eval uses the filename of the binding if none is provided"
35
- fails "Kernel#eval uses the receiver as self inside the eval"
36
44
  fails "Kernel#eval uses the same scope for local variables when given the same binding"
37
45
  fails "Kernel#extend calls extend_object on argument"
38
46
  fails "Kernel#extend does not calls append_features on arguments metaclass"
39
- fails "Kernel#extend makes the class a kind_of? the argument"
40
47
  fails "Kernel#extend on frozen instance raises a RuntimeError"
41
48
  fails "Kernel#extend on frozen instance raises an ArgumentError when no arguments given"
42
49
  fails "Kernel#extend raises an ArgumentError when no arguments given"
@@ -56,10 +63,8 @@ opal_filter "Kernel" do
56
63
  fails "Kernel#instance_variable_set on frozen objects raises a RuntimeError when passed replacement is different from stored object"
57
64
  fails "Kernel#instance_variable_set on frozen objects raises a RuntimeError when passed replacement is identical to stored object"
58
65
  fails "Kernel#instance_variables immediate values returns the correct array if an instance variable is added"
59
- fails "Kernel#is_a? returns true if given a Module that object has been extended with"
60
66
  fails "Kernel#iterator? is a private method"
61
67
  fails "Kernel#itself returns the receiver itself"
62
- fails "Kernel#kind_of? returns true if given a Module that object has been extended with"
63
68
  fails "Kernel#local_variables contains locals as they are added"
64
69
  fails "Kernel#local_variables is a private method"
65
70
  fails "Kernel#local_variables is accessible from bindings"
@@ -120,7 +125,6 @@ opal_filter "Kernel" do
120
125
  fails "Kernel#public_send raises a NoMethodError if the named method is private"
121
126
  fails "Kernel#puts delegates to $stdout.puts"
122
127
  fails "Kernel#puts is a private method"
123
- fails "Kernel#raise raises RuntimeError if no exception class is given"
124
128
  fails "Kernel#respond_to? does not change method visibility when finding private method"
125
129
  fails "Kernel#respond_to? is only an instance method"
126
130
  fails "Kernel#respond_to? returns false even if obj responds to the given private method (include_private = false)"
@@ -231,13 +235,24 @@ opal_filter "Kernel" do
231
235
  fails "Kernel#singleton_methods when passed true returns the names of singleton methods for an object extented with two modules"
232
236
  fails "Kernel#singleton_methods when passed true returns the names of singleton methods for an object"
233
237
  fails "Kernel#warn requires multiple arguments"
234
- fails "Kernel.Array does not call #to_a on an Array"
235
238
  fails "Kernel.Complex() when passed Numerics n1 and n2 and at least one responds to #real? with false returns n1 + n2 * Complex(0, 1)"
236
239
  fails "Kernel.Complex() when passed [Complex, Complex] returns a new Complex number based on the two given numbers"
237
240
  fails "Kernel.Complex() when passed [Complex] returns the passed Complex number"
238
241
  fails "Kernel.Complex() when passed a Numeric which responds to #real? with false returns the passed argument"
239
242
  fails "Kernel.Complex() when passed a non-Numeric second argument raises TypeError"
240
243
  fails "Kernel.Complex() when passed a single non-Numeric coerces the passed argument using #to_c"
244
+ fails "Kernel.Float for hexadecimal literals with binary exponent allows embedded _ in a number on either side of the P"
245
+ fails "Kernel.Float for hexadecimal literals with binary exponent allows embedded _ in a number on either side of the p"
246
+ fails "Kernel.Float for hexadecimal literals with binary exponent allows hexadecimal points on the left side of the 'P'"
247
+ fails "Kernel.Float for hexadecimal literals with binary exponent allows hexadecimal points on the left side of the 'p'"
248
+ fails "Kernel.Float for hexadecimal literals with binary exponent interprets the exponent (on the right of 'P') in decimal"
249
+ fails "Kernel.Float for hexadecimal literals with binary exponent interprets the exponent (on the right of 'p') in decimal"
250
+ fails "Kernel.Float for hexadecimal literals with binary exponent interprets the fractional part (on the left side of 'P') in hexadecimal"
251
+ fails "Kernel.Float for hexadecimal literals with binary exponent interprets the fractional part (on the left side of 'p') in hexadecimal"
252
+ fails "Kernel.Float for hexadecimal literals with binary exponent returns 0 for '0x1P-10000'"
253
+ fails "Kernel.Float for hexadecimal literals with binary exponent returns 0 for '0x1p-10000'"
254
+ fails "Kernel.Float for hexadecimal literals with binary exponent returns Infinity for '0x1P10000'"
255
+ fails "Kernel.Float for hexadecimal literals with binary exponent returns Infinity for '0x1p10000'"
241
256
  fails "Kernel.Rational when passed a String converts the String to a Rational using the same method as String#to_r"
242
257
  fails "Kernel.Rational when passed a String does not use the same method as Float#to_r"
243
258
  fails "Kernel.Rational when passed a String raises a TypeError if the first argument is a Symbol"
@@ -31,49 +31,14 @@ opal_filter "language" do
31
31
  fails "A constant on a singleton class is not defined on the object's class"
32
32
  fails "A constant on a singleton class is not preserved when the object is duped"
33
33
  fails "A constant on a singleton class raises a NameError for anonymous_module::CONST"
34
- fails "A lambda expression 'lambda { ... }' assigns variables from parameters for definition \n @a = lambda do |(a, b, *c, d), (*e, f, g), (*h)|\n [a, b, c, d, e, f, g, h]\n end"
35
- fails "A lambda expression 'lambda { ... }' assigns variables from parameters for definition \n @a = lambda do |a, (b, (c, *d, (e, (*f)), g), (h, (i, j)))|\n [a, b, c, d, e, f, g, h, i, j]\n end"
36
- fails "A lambda expression 'lambda { ... }' assigns variables from parameters for definition \n @a = lambda do |a, b=1, *c, (*d, (e)), f: 2, g:, h:, **k, &l|\n [a, b, c, d, e, f, g, h, k, l]\n end"
37
- fails "A lambda expression 'lambda { ... }' assigns variables from parameters for definition \n @a = lambda do |a, b=1, *c, d, e:, f: 2, g:, **k, &l|\n [a, b, c, d, e, f, g, k, l]\n end"
38
- fails "A lambda expression 'lambda { ... }' assigns variables from parameters for definition \n @a = lambda do |a: (@a = -> (a: 1) { a }), b:|\n [a, b]\n end"
39
- fails "A lambda expression 'lambda { ... }' assigns variables from parameters for definition \n @a = lambda { |(*a, b)| [a, b] }"
40
- fails "A lambda expression 'lambda { ... }' assigns variables from parameters for definition \n @a = lambda { |(a)| a }"
41
- fails "A lambda expression 'lambda { ... }' assigns variables from parameters for definition \n @a = lambda { |**k| k }"
42
- fails "A lambda expression 'lambda { ... }' assigns variables from parameters for definition \n @a = lambda { |**| }"
43
- fails "A lambda expression 'lambda { ... }' assigns variables from parameters for definition \n @a = lambda { |*, &b| b }"
44
- fails "A lambda expression 'lambda { ... }' assigns variables from parameters for definition \n @a = lambda { |*, **k| k }"
45
- fails "A lambda expression 'lambda { ... }' assigns variables from parameters for definition \n @a = lambda { |*| }"
46
- fails "A lambda expression 'lambda { ... }' assigns variables from parameters for definition \n @a = lambda { |a, | a }"
47
- fails "A lambda expression 'lambda { ... }' assigns variables from parameters for definition \n @a = lambda { |a: 1, b: 2| [a, b] }"
48
- fails "A lambda expression 'lambda { ... }' assigns variables from parameters for definition \n @a = lambda { |a: 1, b:| [a, b] }"
49
- fails "A lambda expression 'lambda { ... }' assigns variables from parameters for definition \n @a = lambda { |a: 1| a }"
50
- fails "A lambda expression 'lambda { ... }' assigns variables from parameters for definition \n @a = lambda { |a:, b: 1| [a, b] }"
51
- fails "A lambda expression 'lambda { ... }' assigns variables from parameters for definition \n @a = lambda { |a:, b:| [a, b] }"
52
- fails "A lambda expression 'lambda { ... }' assigns variables from parameters for definition \n @a = lambda { |a:| a }"
34
+ fails "A lambda expression 'lambda { ... }' assigns variables from parameters for definition '@a = lambda { |a, | a }'" # requires arity checking to be enabled
53
35
  fails "A lambda expression 'lambda { ... }' assigns variables from parameters for definition \n def m(*a) yield(*a) end\n @a = lambda { |a| a }"
54
36
  fails "A lambda expression 'lambda { ... }' assigns variables from parameters for definition \n def m(a) yield a end\n def m2() yield end\n @a = lambda { |a, | a }"
55
37
  fails "A lambda expression 'lambda { ... }' requires a block"
56
38
  fails "A lambda expression 'lambda { ... }' with an implicit block can be created"
57
- fails "A lambda literal -> () { } assigns variables from parameters for definition \n @a = -> ((*a, b)) { [a, b] }"
58
- fails "A lambda literal -> () { } assigns variables from parameters for definition \n @a = -> ((a)) { a }"
59
- fails "A lambda literal -> () { } assigns variables from parameters for definition \n @a = -> ((a, b, *c, d), (*e, f, g), (*h)) do\n [a, b, c, d, e, f, g, h]\n end"
60
- fails "A lambda literal -> () { } assigns variables from parameters for definition \n @a = -> (*) { }"
61
- fails "A lambda literal -> () { } assigns variables from parameters for definition \n @a = -> (**) { }"
62
- fails "A lambda literal -> () { } assigns variables from parameters for definition \n @a = -> (**k) { k }"
63
- fails "A lambda literal -> () { } assigns variables from parameters for definition \n @a = -> (*, &b) { b }"
64
- fails "A lambda literal -> () { } assigns variables from parameters for definition \n @a = -> (*, **k) { k }"
65
- fails "A lambda literal -> () { } assigns variables from parameters for definition \n @a = -> (a, (b, (c, *d, (e, (*f)), g), (h, (i, j)))) do\n [a, b, c, d, e, f, g, h, i, j]\n end"
66
- fails "A lambda literal -> () { } assigns variables from parameters for definition \n @a = -> (a, b) { [a, b] }"
67
- fails "A lambda literal -> () { } assigns variables from parameters for definition \n @a = -> (a, b=1, *c, (*d, (e)), f: 2, g:, h:, **k, &l) do\n [a, b, c, d, e, f, g, h, k, l]\n end"
68
- fails "A lambda literal -> () { } assigns variables from parameters for definition \n @a = -> (a: 1) { a }"
69
- fails "A lambda literal -> () { } assigns variables from parameters for definition \n @a = -> (a: 1, b: 2) { [a, b] }"
70
- fails "A lambda literal -> () { } assigns variables from parameters for definition \n @a = -> (a: 1, b:) { [a, b] }"
39
+ fails "A lambda literal -> () { } assigns variables from parameters for definition '@a = -> (a, b) { [a, b] }'"
40
+ fails "A lambda literal -> () { } assigns variables from parameters for definition '@a = -> (a={}) { a }'"
71
41
  fails "A lambda literal -> () { } assigns variables from parameters for definition \n @a = -> (a: @a = -> (a: 1) { a }, b:) do\n [a, b]\n end"
72
- fails "A lambda literal -> () { } assigns variables from parameters for definition \n @a = -> (a:) { a }"
73
- fails "A lambda literal -> () { } assigns variables from parameters for definition \n @a = -> (a:, b: 1) { [a, b] }"
74
- fails "A lambda literal -> () { } assigns variables from parameters for definition \n @a = -> (a:, b:) { [a, b] }"
75
- fails "A lambda literal -> () { } assigns variables from parameters for definition \n @a = -> (a={}) { a }"
76
- fails "A lambda literal -> () { } assigns variables from parameters for definition \n @a = -> a, b=1, *c, d, e:, f: 2, g:, **k, &l do\n [a, b, c, d, e, f, g, k, l]\n end"
77
42
  fails "A lambda literal -> () { } assigns variables from parameters with circular optional argument reference shadows an existing local with the same name as the argument"
78
43
  fails "A lambda literal -> () { } assigns variables from parameters with circular optional argument reference shadows an existing method with the same name as the argument"
79
44
  fails "A lambda literal -> () { } returns a Proc object when used in a BasicObject method"
@@ -89,22 +54,11 @@ opal_filter "language" do
89
54
  fails "A number literal can be an integer literal with trailing 'r' to represent a Rational"
90
55
  fails "A number literal can be an octal literal with trailing 'r' to represent a Rational"
91
56
  fails "A singleton class doesn't have singleton class"
92
- fails "A singleton class for BasicObject has Class as it's superclass"
93
- fails "A singleton class for BasicObject has the proper level of superclass for Class"
94
- fails "A singleton class inherits from Class for classes"
95
57
  fails "A singleton class is a subclass of Class's singleton class"
96
- fails "A singleton class is a subclass of a superclass's singleton class"
97
58
  fails "A singleton class is a subclass of the same level of Class's singleton class"
98
- fails "A singleton class is a subclass of the same level of superclass's singleton class"
99
59
  fails "A singleton class raises a TypeError for Fixnum's"
100
60
  fails "A singleton class raises a TypeError for symbols"
101
61
  fails "An ensure block inside a begin block is executed even when a symbol is thrown in it's corresponding begin block"
102
- fails "Assigning an anonymous module to a constant sets the name of contained modules when assigning a toplevel anonymous module"
103
- fails "Assigning an anonymous module to a constant sets the name of the module"
104
- fails "Class methods of a singleton class for a class include class methods of Class"
105
- fails "Class methods of a singleton class for a class include instance methods of the singleton class of Class"
106
- fails "Class methods of a singleton class for a singleton class include class methods of the singleton class of Class"
107
- fails "Instance methods of a singleton class for a singleton class includes instance methods of the singleton class of Class"
108
62
  fails "Instantiating a singleton class raises a TypeError when allocate is called"
109
63
  fails "Instantiating a singleton class raises a TypeError when new is called"
110
64
  fails "Literal Regexps caches the Regexp object"
@@ -121,8 +75,13 @@ opal_filter "language" do
121
75
  fails "Literal Regexps supports non-paired delimiters delimiters with %r"
122
76
  fails "Literal Regexps supports possessive quantifiers"
123
77
  fails "Literal Regexps throws SyntaxError for malformed literals"
78
+ fails "Magic comment is optional"
124
79
  fails "Operators * / % are left-associative"
125
- fails "Reopening a class adds new methods to subclasses"
80
+ fails "Optional variable assignments using compunded constants with ||= assignments"
81
+ fails "Optional variable assignments using compunded constants with &&= assignments"
82
+ fails "Optional variable assignments using compunded constants with &&= assignments will fail with non-existant constants"
83
+ fails "Optional variable assignments using compunded constants with operator assignments"
84
+ fails "Optional variable assignments using compunded constants with operator assignments will fail with non-existant constants"
126
85
  fails "The =~ operator with named captures on syntax of /regexp/ =~ string_variable sets local variables by the captured pairs"
127
86
  fails "The =~ operator with named captures on syntax of regexp_variable =~ string_variable does not set local variables"
128
87
  fails "The =~ operator with named captures on syntax of string_variable =~ /regexp/ does not set local variables"
@@ -132,6 +91,12 @@ opal_filter "language" do
132
91
  fails "The BEGIN keyword runs first in a given code unit"
133
92
  fails "The BEGIN keyword runs in a shared scope"
134
93
  fails "The BEGIN keyword runs multiple begins in FIFO order"
94
+ fails "The __ENCODING__ pseudo-variable is US-ASCII by default"
95
+ fails "The __ENCODING__ pseudo-variable is an instance of Encoding"
96
+ fails "The __ENCODING__ pseudo-variable is the encoding specified by a magic comment in the file"
97
+ fails "The __ENCODING__ pseudo-variable is the encoding specified by a magic comment inside an eval"
98
+ fails "The __ENCODING__ pseudo-variable is the evaluated strings's one inside an eval"
99
+ fails "The __ENCODING__ pseudo-variable raises a SyntaxError if assigned to"
135
100
  fails "The __FILE__ pseudo-variable equals the absolute path of a file loaded by a relative path" # we can't clear $LOADED_FEATURES, should be treated as readonly
136
101
  fails "The __FILE__ pseudo-variable equals the absolute path of a file loaded by an absolute path" # we can't clear $LOADED_FEATURES, should be treated as readonly
137
102
  fails "The __LINE__ pseudo-variable equals the line number of the text in a loaded file"
@@ -164,15 +129,6 @@ opal_filter "language" do
164
129
  fails "The defined? keyword for literals for a literal Array returns nil if all elements are not defined"
165
130
  fails "The defined? keyword for literals for a literal Array returns nil if one element is not defined"
166
131
  fails "The defined? keyword for loop expressions returns 'expression' for a 'retry' expression"
167
- fails "The defined? keyword for super for a method taking arguments returns nil from a #define_method when no superclass method exists"
168
- fails "The defined? keyword for super for a method taking arguments returns nil from a block in a #define_method when no superclass method exists"
169
- fails "The defined? keyword for super for a method taking arguments returns nil from a block when no superclass method exists"
170
- fails "The defined? keyword for super for a method taking arguments returns nil when no superclass method exists"
171
- fails "The defined? keyword for super for a method taking no arguments returns nil from a #define_method when no superclass method exists"
172
- fails "The defined? keyword for super for a method taking no arguments returns nil from a block in a #define_method when no superclass method exists"
173
- fails "The defined? keyword for super for a method taking no arguments returns nil from a block when no superclass method exists"
174
- fails "The defined? keyword for super for a method taking no arguments returns nil when no superclass method exists"
175
- fails "The defined? keyword for super returns nil when a superclass undef's the method"
176
132
  fails "The defined? keyword for variables returns 'instance-variable' for an instance variable that has been assigned to nil"
177
133
  fails "The defined? keyword for variables returns nil for a global variable that has been read but not assigned to"
178
134
  fails "The defined? keyword for variables when a Regexp matches a String returns nil for non-captures"
@@ -194,22 +150,20 @@ opal_filter "language" do
194
150
  fails "The if expression with a boolean range ('flip-flop' operator) mimics an awk conditional with a many-element inclusive-end range"
195
151
  fails "The if expression with a boolean range ('flip-flop' operator) mimics an awk conditional with a single-element inclusive-end range"
196
152
  fails "The if expression with a boolean range ('flip-flop' operator) scopes state by flip-flop"
153
+ fails "The not keyword accepts an argument"
197
154
  fails "The or operator has a lower precedence than 'next' in 'next true or false'"
198
155
  fails "The redo statement in a method is invalid and raises a SyntaxError"
199
156
  fails "The redo statement triggers ensure block when re-executing a block"
200
157
  fails "The rescue keyword parses 'a += b rescue c' as 'a += (b rescue c)'"
201
- fails "The rescue keyword will execute an else block only if no exceptions were raised"
202
- fails "The rescue keyword will not rescue errors raised in an else block in the rescue block above it"
203
- fails "The rescue keyword without classes will not rescue Exception"
204
158
  fails "The retry keyword inside a begin block's rescue block causes the begin block to be executed again"
205
159
  fails "The retry statement raises a SyntaxError when used outside of a begin statement"
206
160
  fails "The retry statement re-executes the closest block"
207
161
  fails "The super keyword calls the correct method when the method visibility is modified"
208
162
  fails "The super keyword passes along modified rest args when they were originally empty"
209
163
  fails "The super keyword passes along modified rest args when they weren't originally empty"
210
- fails "The super keyword raises a RuntimeError when called with implicit arguments from a method defined with define_method"
211
- fails "The super keyword raises an error error when super method does not exist"
164
+ fails "The super keyword sees the included version of a module a method is alias from"
212
165
  fails "The super keyword uses given block even if arguments are passed explicitly"
166
+ fails "The super keyword when using keyword arguments passes any given keyword arguments including optional and required ones to the parent"
213
167
  fails "The super keyword without explicit arguments passes arguments and rest arguments including any modifications"
214
168
  fails "The super keyword without explicit arguments passes optional arguments that have a default value but were modified"
215
169
  fails "The super keyword without explicit arguments passes optional arguments that have a default value"
@@ -231,10 +185,107 @@ opal_filter "language" do
231
185
  fails "The while modifier with begin .. end block restarts the current iteration without reevaluting condition with redo"
232
186
  fails "The while modifier with begin .. end block runs block at least once (even if the expression is false)"
233
187
  fails "The while modifier with begin .. end block skips to end of body with next"
234
- fails "calling methods on the metaclass calls a method defined on the metaclass of the metaclass"
235
- fails "not() returns false if the argument is true"
236
- fails "not() returns true if the argument is false"
237
- fails "not() returns true if the argument is nil"
238
188
  fails "self in a metaclass body (class << obj) raises a TypeError for numbers"
239
189
  fails "self in a metaclass body (class << obj) raises a TypeError for symbols"
190
+ fails "Execution variable $: is initialized to an array of strings"
191
+ fails "Execution variable $: is the same object as $LOAD_PATH and $-I"
192
+ fails "Execution variable $: is read-only"
193
+ fails "Global variable $\" is read-only"
194
+ fails "Global variable $< is read-only"
195
+ fails "Global variable $FILENAME is read-only"
196
+ fails "Global variable $? is read-only"
197
+ fails "Global variable $-a is read-only"
198
+ fails "Global variable $-l is read-only"
199
+ fails "Global variable $-p is read-only"
200
+ fails "Global variable $-d is an alias of $DEBUG"
201
+ fails "Global variable $-v is an alias of $VERBOSE"
202
+ fails "Global variable $-w is an alias of $VERBOSE"
203
+ fails "Global variable $0 raises a TypeError when not given an object that can be coerced to a String"
204
+ fails "Global variable $? is thread-local"
205
+ fails "Predefined global $! remains nil after a failed core class \"checked\" coercion against a class that defines method_missing"
206
+ fails "Predefined global $! should be set to the value of $! before the begin after a successful rescue"
207
+ fails "Predefined global $! should be set to the value of $! before the begin after a successful rescue within an ensure"
208
+ fails "Predefined global $! should be set to the new exception after a throwing rescue"
209
+ fails "Predefined global $! in bodies without ensure should be cleared when an exception is rescued"
210
+ fails "Predefined global $! in bodies without ensure should be cleared when an exception is rescued even when a non-local return is present"
211
+ fails "Predefined global $! in bodies without ensure should not be cleared when an exception is not rescued"
212
+ fails "Predefined global $! in bodies without ensure should not be cleared when an exception is rescued and rethrown"
213
+ fails "Predefined global $! in ensure-protected bodies should be cleared when an exception is rescued"
214
+ fails "Predefined global $~ is set at the method-scoped level rather than block-scoped"
215
+ fails "Predefined global $~ raises an error if assigned an object not nil or instanceof MatchData"
216
+ fails "Predefined global $+ is equivalent to $~.captures.last"
217
+ fails "Predefined global $+ captures the last non nil capture"
218
+ fails "Predefined global $stdout raises TypeError error if assigned to nil"
219
+ fails "Predefined global $stdout raises TypeError error if assigned to object that doesn't respond to #write"
220
+ fails "Predefined global $/ changes $-0"
221
+ fails "Predefined global $/ does not call #to_str to convert the object to a String"
222
+ fails "Predefined global $/ raises a TypeError if assigned a Fixnum"
223
+ fails "Predefined global $/ raises a TypeError if assigned a boolean"
224
+ fails "Predefined global $-0 changes $/"
225
+ fails "Predefined global $-0 does not call #to_str to convert the object to a String"
226
+ fails "Predefined global $-0 raises a TypeError if assigned a Fixnum"
227
+ fails "Predefined global $-0 raises a TypeError if assigned a boolean"
228
+ fails "Predefined global $, raises TypeError if assigned a non-String"
229
+ fails "Predefined global $_ is set to the last line read by e.g. StringIO#gets"
230
+ fails "Predefined global $_ is set at the method-scoped level rather than block-scoped"
231
+ fails "Predefined global $_ is Thread-local"
232
+ fails "The predefined global constants includes TOPLEVEL_BINDING"
233
+ fails "A block yielded a single Array assigns the first element to a single argument with trailing comma"
234
+ fails "A block yielded a single Array assigns elements to required arguments when a keyword rest argument is present"
235
+ fails "A block yielded a single Array assigns symbol keys from a Hash to keyword arguments"
236
+ fails "A block yielded a single Array assigns symbol keys from a Hash returned by #to_hash to keyword arguments"
237
+ fails "A block yielded a single Array calls #to_hash on the argument but does not use the result when no keywords are present"
238
+ fails "A block yielded a single Array assigns non-symbol keys to non-keyword arguments"
239
+ fails "A block yielded a single Array does not treat hashes with string keys as keyword arguments"
240
+ fails "A block yielded a single Array assigns the last element to a non-keyword argument if #to_hash returns nil"
241
+ fails "A block yielded a single Array raises a TypeError if #to_hash does not return a Hash"
242
+ fails "A block yielded a single Object calls #to_ary on the object when taking multiple arguments"
243
+ fails "A block yielded a single Object receives the object if #to_ary returns nil"
244
+ fails "A block yielded a single Object raises a TypeError if #to_ary does not return an Array"
245
+ fails "A block allows for a leading space before the arguments"
246
+ fails "A block taking |a, b| arguments calls #to_ary to convert a single yielded object to an Array"
247
+ fails "A block taking |a, b| arguments raises a TypeError if #to_ary does not return an Array"
248
+ fails "A block taking |a, b| arguments raises the original exception if #to_ary raises an exception"
249
+ fails "A block taking |a, *b| arguments calls #to_ary to convert a single yielded object to an Array"
250
+ fails "A block taking |a, *b| arguments raises a TypeError if #to_ary does not return an Array"
251
+ fails "A block taking |a, | arguments assigns nil to the argument when passed an empty Array"
252
+ fails "A block taking |a, | arguments assigns the argument the first element of the Array when passed a single Array"
253
+ fails "A block taking |a, | arguments calls #to_ary to convert a single yielded object to an Array"
254
+ fails "A block taking |a, | arguments does not call #to_ary if the single yielded object is an Array"
255
+ fails "A block taking |a, | arguments raises a TypeError if #to_ary does not return an Array"
256
+ fails "A block taking |(a, b)| arguments calls #to_ary to convert a single yielded object to an Array"
257
+ fails "A block taking |(a, b)| arguments raises a TypeError if #to_ary does not return an Array"
258
+ fails "A block taking |(a, b), c| arguments calls #to_ary to convert a single yielded object to an Array"
259
+ fails "A block taking |(a, b), c| arguments raises a TypeError if #to_ary does not return an Array"
260
+ fails "A block taking identically-named arguments raises a SyntaxError for standard arguments"
261
+ fails "Block-local variables can not have the same name as one of the standard parameters"
262
+ fails "Block-local variables override shadowed variables from the outer scope"
263
+ fails "Post-args are required"
264
+ fails "Post-args with optional args with a circular argument reference shadows an existing method with the same name as the argument"
265
+ fails "Post-args with optional args with a circular argument reference shadows an existing local with the same name as the argument"
266
+ fails "The break statement in a captured block when the invocation of the scope creating the block is still active raises a LocalJumpError when invoking the block from the scope creating the block"
267
+ fails "The break statement in a captured block when the invocation of the scope creating the block is still active raises a LocalJumpError when invoking the block from a method"
268
+ fails "The break statement in a captured block from a scope that has returned raises a LocalJumpError when calling the block from a method"
269
+ fails "The break statement in a captured block when the invocation of the scope creating the block is still active raises a LocalJumpError when yielding to the block"
270
+ fails "The break statement in a captured block from a scope that has returned raises a LocalJumpError when yielding to the block"
271
+ fails "The break statement in a lambda when the invocation of the scope creating the lambda is still active raises a LocalJumpError when yielding to a lambda passed as a block argument"
272
+ fails "The break statement in a lambda created at the toplevel returns a value when invoking from the toplevel"
273
+ fails "The break statement in a lambda created at the toplevel returns a value when invoking from a method"
274
+ fails "The break statement in a lambda created at the toplevel returns a value when invoking from a block"
275
+ fails "The break statement in a lambda from a scope that has returned raises a LocalJumpError when yielding to a lambda passed as a block argument"
276
+ fails "Break inside a while loop with a value passes the value returned by a method with omitted parenthesis and passed block"
277
+ fails "Executing break from within a block returns from the original invoking method even in case of chained calls"
278
+ fails "A Proc taking zero arguments raises an ArgumentErro if a value is passed"
279
+ fails "A Proc taking || arguments raises an ArgumentError if a value is passed"
280
+ fails "A Proc taking |a| arguments raises an ArgumentError if no value is passed"
281
+ fails "A Proc taking |a, b| arguments raises an ArgumentError if passed no values"
282
+ fails "A Proc taking |a, b| arguments raises an ArgumentError if passed one value"
283
+ fails "A Proc taking |a, b| arguments does not call #to_ary to convert a single passed object to an Array"
284
+ fails "A Proc taking |a, *b| arguments raises an ArgumentError if passed no values"
285
+ fails "A Proc taking |a, | arguments raises an ArgumentError when passed no values"
286
+ fails "A Proc taking |a, | arguments raises an ArgumentError when passed more than one value"
287
+ fails "A Proc taking |(a, b)| arguments raises an ArgumentError when passed no values"
288
+ fails "A Proc taking |(a, b)| arguments calls #to_ary to convert a single passed object to an Array"
289
+ fails "A Proc taking |(a, b)| arguments calls #to_ary to convert a single passed object to an Array"
290
+ fails "A Proc taking |(a, b)| arguments raises a TypeError if #to_ary does not return an Array"
240
291
  end