opal 0.5.5 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (257) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +40 -9
  3. data/CHANGELOG.md +349 -0
  4. data/Gemfile +7 -8
  5. data/README.md +25 -3
  6. data/Rakefile +4 -2
  7. data/bin/opal +1 -1
  8. data/examples/rack/Gemfile +3 -0
  9. data/examples/rack/app/application.rb +13 -0
  10. data/examples/rack/app/user.rb +21 -0
  11. data/examples/rack/config.ru +7 -0
  12. data/examples/rack/index.html.erb +10 -0
  13. data/examples/sinatra/Gemfile +4 -0
  14. data/examples/sinatra/app/application.rb +7 -0
  15. data/examples/sinatra/config.ru +21 -0
  16. data/lib/mspec/opal/rake_task.rb +29 -8
  17. data/lib/mspec/opal/runner.rb +5 -4
  18. data/lib/opal.rb +1 -0
  19. data/lib/opal/builder.rb +0 -28
  20. data/lib/opal/cli.rb +0 -14
  21. data/lib/opal/compiler.rb +12 -11
  22. data/lib/opal/fragment.rb +8 -1
  23. data/lib/opal/nodes/array.rb +1 -1
  24. data/lib/opal/nodes/base.rb +4 -0
  25. data/lib/opal/nodes/call.rb +6 -2
  26. data/lib/opal/nodes/call_special.rb +1 -1
  27. data/lib/opal/nodes/class.rb +2 -2
  28. data/lib/opal/nodes/constants.rb +3 -1
  29. data/lib/opal/nodes/helpers.rb +23 -14
  30. data/lib/opal/nodes/if.rb +16 -9
  31. data/lib/opal/nodes/literal.rb +37 -5
  32. data/lib/opal/nodes/logic.rb +7 -1
  33. data/lib/opal/nodes/module.rb +2 -2
  34. data/lib/opal/nodes/scope.rb +13 -2
  35. data/lib/opal/nodes/top.rb +9 -0
  36. data/lib/opal/nodes/variables.rb +5 -2
  37. data/lib/opal/parser.rb +306 -71
  38. data/lib/opal/parser/grammar.rb +2667 -2775
  39. data/lib/opal/parser/grammar.y +177 -233
  40. data/lib/opal/parser/lexer.rb +511 -427
  41. data/lib/opal/parser/sexp.rb +15 -3
  42. data/lib/opal/source_map.rb +8 -4
  43. data/lib/opal/sprockets.rb +4 -0
  44. data/lib/opal/sprockets/cache_key_fix.rb +17 -0
  45. data/lib/opal/sprockets/environment.rb +21 -0
  46. data/lib/opal/sprockets/erb.rb +30 -0
  47. data/lib/opal/sprockets/processor.rb +127 -0
  48. data/lib/opal/sprockets/server.rb +166 -0
  49. data/lib/opal/util.rb +29 -0
  50. data/lib/opal/version.rb +1 -1
  51. data/opal.gemspec +1 -1
  52. data/opal/corelib/array.rb +106 -187
  53. data/opal/corelib/array/inheritance.rb +113 -0
  54. data/opal/corelib/basic_object.rb +6 -2
  55. data/opal/corelib/boolean.rb +4 -0
  56. data/opal/corelib/class.rb +2 -0
  57. data/opal/corelib/complex.rb +3 -0
  58. data/opal/corelib/enumerable.rb +75 -8
  59. data/opal/corelib/enumerator.rb +2 -0
  60. data/opal/corelib/error.rb +23 -23
  61. data/opal/corelib/hash.rb +5 -5
  62. data/opal/corelib/helpers.rb +51 -16
  63. data/opal/corelib/io.rb +7 -24
  64. data/opal/corelib/kernel.rb +23 -11
  65. data/opal/corelib/module.rb +44 -47
  66. data/opal/corelib/nil_class.rb +4 -0
  67. data/opal/corelib/numeric.rb +101 -15
  68. data/opal/corelib/range.rb +2 -0
  69. data/opal/corelib/rational.rb +3 -0
  70. data/opal/corelib/regexp.rb +36 -17
  71. data/opal/corelib/runtime.js +22 -7
  72. data/opal/corelib/string.rb +213 -110
  73. data/opal/corelib/string/inheritance.rb +78 -0
  74. data/opal/corelib/struct.rb +8 -0
  75. data/opal/corelib/time.rb +54 -42
  76. data/opal/corelib/variables.rb +24 -0
  77. data/opal/opal.rb +5 -27
  78. data/spec/cli/compiler_spec.rb +136 -0
  79. data/spec/cli/dependency_resolver_spec.rb +40 -0
  80. data/spec/cli/lexer_spec.rb +110 -0
  81. data/spec/cli/parser/alias_spec.rb +26 -0
  82. data/spec/cli/parser/and_spec.rb +13 -0
  83. data/spec/cli/parser/attrasgn_spec.rb +28 -0
  84. data/spec/cli/parser/begin_spec.rb +42 -0
  85. data/spec/cli/parser/block_spec.rb +12 -0
  86. data/spec/cli/parser/break_spec.rb +17 -0
  87. data/spec/cli/parser/call_spec.rb +139 -0
  88. data/spec/cli/parser/class_spec.rb +35 -0
  89. data/spec/cli/parser/comments_spec.rb +11 -0
  90. data/spec/cli/parser/def_spec.rb +61 -0
  91. data/spec/cli/parser/if_spec.rb +26 -0
  92. data/spec/cli/parser/iter_spec.rb +59 -0
  93. data/spec/cli/parser/lambda_spec.rb +64 -0
  94. data/spec/cli/parser/literal_spec.rb +113 -0
  95. data/spec/cli/parser/masgn_spec.rb +37 -0
  96. data/spec/cli/parser/module_spec.rb +27 -0
  97. data/spec/cli/parser/not_spec.rb +27 -0
  98. data/spec/cli/parser/op_asgn1_spec.rb +23 -0
  99. data/spec/cli/parser/op_asgn2_spec.rb +23 -0
  100. data/spec/cli/parser/or_spec.rb +13 -0
  101. data/spec/cli/parser/return_spec.rb +17 -0
  102. data/spec/cli/parser/sclass_spec.rb +21 -0
  103. data/spec/cli/parser/string_spec.rb +269 -0
  104. data/spec/cli/parser/super_spec.rb +20 -0
  105. data/spec/cli/parser/undef_spec.rb +15 -0
  106. data/spec/cli/parser/unless_spec.rb +13 -0
  107. data/spec/cli/parser/variables_spec.rb +92 -0
  108. data/spec/cli/parser/while_spec.rb +15 -0
  109. data/spec/cli/parser/yield_spec.rb +20 -0
  110. data/spec/cli/spec_helper.rb +31 -11
  111. data/spec/opal/core/array/set_range_to_array_spec.rb +7 -0
  112. data/spec/opal/core/date_spec.rb +122 -0
  113. data/spec/opal/core/language/predefined_spec.rb +1 -1
  114. data/spec/opal/core/runtime/operator_call_spec.rb +13 -0
  115. data/spec/opal/core/runtime/truthy_spec.rb +23 -0
  116. data/spec/opal/filters/bugs/array.rb +96 -87
  117. data/spec/opal/filters/bugs/basic_object.rb +9 -0
  118. data/spec/opal/filters/bugs/class.rb +16 -0
  119. data/spec/opal/filters/bugs/enumerable.rb +54 -0
  120. data/spec/opal/filters/bugs/language.rb +37 -3
  121. data/spec/opal/filters/bugs/math.rb +93 -0
  122. data/spec/opal/filters/bugs/nil.rb +7 -0
  123. data/spec/opal/filters/bugs/numeric.rb +19 -0
  124. data/spec/opal/filters/bugs/opal.rb +12 -0
  125. data/spec/opal/filters/bugs/regexp.rb +0 -2
  126. data/spec/opal/filters/bugs/string.rb +317 -19
  127. data/spec/opal/filters/bugs/struct.rb +29 -0
  128. data/spec/opal/filters/bugs/time.rb +130 -9
  129. data/spec/opal/filters/unsupported/encoding.rb +52 -4
  130. data/spec/opal/filters/unsupported/enumerator.rb +0 -3
  131. data/spec/opal/filters/unsupported/integer_size.rb +7 -0
  132. data/spec/opal/filters/unsupported/method_added.rb +10 -0
  133. data/spec/opal/filters/unsupported/mutable_strings.rb +299 -1
  134. data/spec/opal/filters/unsupported/private_constants.rb +30 -0
  135. data/spec/opal/filters/unsupported/private_methods.rb +16 -0
  136. data/spec/opal/filters/unsupported/random.rb +4 -0
  137. data/spec/opal/filters/unsupported/tainted.rb +53 -0
  138. data/spec/opal/filters/unsupported/trusted.rb +5 -0
  139. data/spec/opal/rubyspecs +167 -234
  140. data/spec/opal/spec_helper.rb +3 -0
  141. data/spec/opal/stdlib/promise/error_spec.rb +15 -0
  142. data/spec/opal/stdlib/promise/rescue_spec.rb +35 -0
  143. data/spec/opal/stdlib/promise/then_spec.rb +54 -0
  144. data/spec/opal/stdlib/promise/trace_spec.rb +35 -0
  145. data/spec/opal/stdlib/promise/value_spec.rb +15 -0
  146. data/spec/opal/stdlib/promise/when_spec.rb +34 -0
  147. data/stdlib/base64.rb +152 -0
  148. data/stdlib/date.rb +82 -49
  149. data/{opal/corelib → stdlib}/encoding.rb +3 -1
  150. data/stdlib/erb.rb +0 -1
  151. data/stdlib/json.rb +10 -26
  152. data/stdlib/math.rb +370 -0
  153. data/stdlib/native.rb +40 -33
  154. data/stdlib/opal-parser.rb +7 -4
  155. data/stdlib/promise.rb +292 -0
  156. data/stdlib/strscan.rb +1 -1
  157. data/stdlib/template.rb +1 -3
  158. data/stdlib/time.rb +9 -0
  159. metadata +143 -204
  160. data/doc/compiler.md +0 -42
  161. data/doc/compiler_options.md +0 -5
  162. data/doc/examples/node_http_server.rb +0 -49
  163. data/doc/external_libraries.md +0 -9
  164. data/doc/generated_javascript.md +0 -272
  165. data/doc/home.md +0 -17
  166. data/doc/method_missing.md +0 -58
  167. data/doc/static_applications.md +0 -60
  168. data/doc/using_ruby_from_javascript.md +0 -18
  169. data/doc/using_sprockets.md +0 -65
  170. data/spec/opal/core/numeric/abs_spec.rb +0 -12
  171. data/spec/opal/core/numeric/downto_spec.rb +0 -19
  172. data/spec/opal/core/numeric/equal_value_spec.rb +0 -9
  173. data/spec/opal/core/numeric/even_spec.rb +0 -21
  174. data/spec/opal/core/numeric/magnitude_spec.rb +0 -12
  175. data/spec/opal/core/numeric/odd_spec.rb +0 -21
  176. data/spec/opal/core/string/chop_spec.rb +0 -10
  177. data/spec/opal/core/string/chr_spec.rb +0 -13
  178. data/spec/opal/core/string/clone_spec.rb +0 -8
  179. data/spec/opal/core/string/comparison_spec.rb +0 -13
  180. data/spec/opal/core/string/dup_spec.rb +0 -8
  181. data/spec/opal/core/string/element_reference_spec.rb +0 -96
  182. data/spec/opal/core/string/fixtures/classes.rb +0 -49
  183. data/spec/opal/core/string/format_spec.rb +0 -9
  184. data/spec/opal/core/string/freeze_spec.rb +0 -15
  185. data/spec/opal/core/string/gsub_spec.rb +0 -31
  186. data/spec/opal/core/string/lines_spec.rb +0 -9
  187. data/spec/opal/core/string/ljust_spec.rb +0 -32
  188. data/spec/opal/core/string/lstrip_spec.rb +0 -7
  189. data/spec/opal/core/string/match_spec.rb +0 -49
  190. data/spec/opal/core/string/next_spec.rb +0 -10
  191. data/spec/opal/core/string/ord_spec.rb +0 -9
  192. data/spec/opal/core/string/partition_spec.rb +0 -10
  193. data/spec/opal/core/string/rindex_spec.rb +0 -50
  194. data/spec/opal/core/string/rjust_spec.rb +0 -32
  195. data/spec/opal/core/string/rstrip_spec.rb +0 -7
  196. data/spec/opal/core/string/scan_spec.rb +0 -66
  197. data/spec/opal/core/string/slice_spec.rb +0 -74
  198. data/spec/opal/core/string/split_spec.rb +0 -5
  199. data/spec/opal/core/string/strip_spec.rb +0 -6
  200. data/spec/opal/core/string/sub_spec.rb +0 -38
  201. data/spec/opal/core/string/succ_spec.rb +0 -10
  202. data/spec/opal/core/string/sum_spec.rb +0 -5
  203. data/spec/opal/core/string/to_f_spec.rb +0 -14
  204. data/spec/opal/core/string/to_i_spec.rb +0 -25
  205. data/spec/opal/core/string/tr_s_spec.rb +0 -31
  206. data/spec/opal/core/string/tr_spec.rb +0 -31
  207. data/spec/opal/filters/bugs/parser.rb +0 -10
  208. data/spec/opal/filters/unsupported/immutable_strings.rb +0 -24
  209. data/spec/opal/filters/unsupported/string_subclasses.rb +0 -8
  210. data/spec/opal/parser/alias_spec.rb +0 -26
  211. data/spec/opal/parser/and_spec.rb +0 -13
  212. data/spec/opal/parser/array_spec.rb +0 -22
  213. data/spec/opal/parser/attrasgn_spec.rb +0 -28
  214. data/spec/opal/parser/begin_spec.rb +0 -42
  215. data/spec/opal/parser/block_spec.rb +0 -12
  216. data/spec/opal/parser/break_spec.rb +0 -17
  217. data/spec/opal/parser/call_spec.rb +0 -131
  218. data/spec/opal/parser/class_spec.rb +0 -35
  219. data/spec/opal/parser/const_spec.rb +0 -13
  220. data/spec/opal/parser/cvar_spec.rb +0 -11
  221. data/spec/opal/parser/def_spec.rb +0 -61
  222. data/spec/opal/parser/false_spec.rb +0 -17
  223. data/spec/opal/parser/file_spec.rb +0 -7
  224. data/spec/opal/parser/gvar_spec.rb +0 -13
  225. data/spec/opal/parser/hash_spec.rb +0 -17
  226. data/spec/opal/parser/heredoc_spec.rb +0 -30
  227. data/spec/opal/parser/iasgn_spec.rb +0 -9
  228. data/spec/opal/parser/if_spec.rb +0 -26
  229. data/spec/opal/parser/int_spec.rb +0 -13
  230. data/spec/opal/parser/iter_spec.rb +0 -59
  231. data/spec/opal/parser/ivar_spec.rb +0 -9
  232. data/spec/opal/parser/lambda_spec.rb +0 -64
  233. data/spec/opal/parser/lasgn_spec.rb +0 -8
  234. data/spec/opal/parser/line_spec.rb +0 -8
  235. data/spec/opal/parser/lvar_spec.rb +0 -38
  236. data/spec/opal/parser/masgn_spec.rb +0 -37
  237. data/spec/opal/parser/module_spec.rb +0 -27
  238. data/spec/opal/parser/nil_spec.rb +0 -17
  239. data/spec/opal/parser/not_spec.rb +0 -27
  240. data/spec/opal/parser/nth_ref_spec.rb +0 -13
  241. data/spec/opal/parser/op_asgn1_spec.rb +0 -23
  242. data/spec/opal/parser/op_asgn2_spec.rb +0 -23
  243. data/spec/opal/parser/or_spec.rb +0 -13
  244. data/spec/opal/parser/parse_spec.rb +0 -66
  245. data/spec/opal/parser/regexp_spec.rb +0 -16
  246. data/spec/opal/parser/return_spec.rb +0 -17
  247. data/spec/opal/parser/sclass_spec.rb +0 -21
  248. data/spec/opal/parser/self_spec.rb +0 -17
  249. data/spec/opal/parser/str_spec.rb +0 -107
  250. data/spec/opal/parser/string_spec.rb +0 -8
  251. data/spec/opal/parser/super_spec.rb +0 -20
  252. data/spec/opal/parser/true_spec.rb +0 -17
  253. data/spec/opal/parser/undef_spec.rb +0 -15
  254. data/spec/opal/parser/unless_spec.rb +0 -13
  255. data/spec/opal/parser/while_spec.rb +0 -15
  256. data/spec/opal/parser/xstr_spec.rb +0 -116
  257. data/spec/opal/parser/yield_spec.rb +0 -20
@@ -1,3 +1,12 @@
1
1
  opal_filter "BasicObject" do
2
2
  fails "BasicObject#instance_eval evaluates strings"
3
+ fails "BasicObject instance metaclass contains methods defined for the BasicObject instance"
4
+ fails "BasicObject instance metaclass has BasicObject as superclass"
5
+ fails "BasicObject instance metaclass is an instance of Class"
6
+ fails "BasicObject metaclass contains methods for the BasicObject class"
7
+ fails "BasicObject metaclass has Class as superclass"
8
+ fails "BasicObject does not define built-in constants (according to defined?)"
9
+ fails "BasicObject does not define built-in constants (according to const_defined?)"
10
+ fails "BasicObject raises NameError when referencing built-in constants"
11
+ fails "BasicObject raises NoMethodError for nonexistent methods after #method_missing is removed"
3
12
  end
@@ -1,4 +1,20 @@
1
1
  opal_filter "Class" do
2
+ fails "Class#allocate returns a fully-formed instance of Module"
3
+ fails "Class#allocate raises TypeError for #superclass"
4
+
5
+ fails "Class#dup stores the new name if assigned to a constant"
6
+ fails "Class#dup sets the name from the class to nil if not assigned to a constant"
7
+ fails "Class#dup retains the correct ancestor chain for the singleton class"
8
+ fails "Class#dup retains an included module in the ancestor chain for the singleton class"
9
+ fails "Class#dup duplicates both the class and the singleton class"
10
+
11
+ fails "Class#initialize_copy raises a TypeError when called on already initialized classes"
12
+ fails "Class#initialize_copy raises a TypeError when called on BasicObject"
13
+ fails "Class#initialize raises a TypeError when called on already initialized classes"
14
+ fails "Class#initialize raises a TypeError when called on BasicObject"
15
+
2
16
  fails "Class.new raises a TypeError if passed a metaclass"
3
17
  fails "Class#new passes the block to #initialize"
18
+
19
+ fails "Class#superclass for a singleton class of a class returns the singleton class of its superclass"
4
20
  end
@@ -8,4 +8,58 @@ opal_filter "Enumerable" do
8
8
 
9
9
  fails "Enumerable#reduce returns nil when fails(legacy rubycon)"
10
10
  fails "Enumerable#reduce without inject arguments(legacy rubycon)"
11
+
12
+ fails "Enumerable#chunk does not yield the object passed to #chunk if it is nil"
13
+ fails "Enumerable#chunk yields an element and an object value-equal but not identical to the object passed to #chunk"
14
+ fails "Enumerable#chunk raises a RuntimeError if the block returns a Symbol starting with an underscore other than :_alone or :_separator"
15
+ fails "Enumerable#chunk does not return elements for which the block returns nil"
16
+ fails "Enumerable#chunk does not return elements for which the block returns :_separator"
17
+ fails "Enumerable#chunk returns elements for which the block returns :_alone in separate Arrays"
18
+ fails "Enumerable#chunk returns elements of the Enumerable in an Array of Arrays, [v, ary], where 'ary' contains the consecutive elements for which the block returned the value 'v'"
19
+ fails "Enumerable#chunk yields the current element and the current chunk to the block"
20
+ fails "Enumerable#chunk returns an Enumerator if given a block"
21
+ fails "Enumerable#chunk raises an ArgumentError if called without a block"
22
+
23
+ fails "Enumerable#each_cons gathers whole arrays as elements when each yields multiple"
24
+ fails "Enumerable#each_cons returns an enumerator if no block"
25
+ fails "Enumerable#each_cons yields only as much as needed"
26
+ fails "Enumerable#each_cons works when n is >= full length"
27
+ fails "Enumerable#each_cons tries to convert n to an Integer using #to_int"
28
+ fails "Enumerable#each_cons raises an Argument Error if there is not a single parameter > 0"
29
+ fails "Enumerable#each_cons passes element groups to the block"
30
+
31
+ fails "Enumerable#each_entry passes extra arguments to #each"
32
+ fails "Enumerable#each_entry passes through the values yielded by #each_with_index"
33
+ fails "Enumerable#each_entry returns an enumerator if no block"
34
+ fails "Enumerable#each_entry yields multiple arguments as an array"
35
+
36
+ fails "Enumerable#minmax_by gathers whole arrays as elements when each yields multiple"
37
+ fails "Enumerable#minmax_by is able to return the maximum for enums that contain nils"
38
+ fails "Enumerable#minmax_by uses min/max.<=>(current) to determine order"
39
+ fails "Enumerable#minmax_by returns the object that appears first in #each in case of a tie"
40
+ fails "Enumerable#minmax_by returns the object for whom the value returned by block is the largest"
41
+ fails "Enumerable#minmax_by returns nil if #each yields no objects"
42
+ fails "Enumerable#minmax_by returns an enumerator if no block"
43
+
44
+ fails "Enumerable#minmax gathers whole arrays as elements when each yields multiple"
45
+ fails "Enumerable#minmax return the minimun when using a block rule"
46
+ fails "Enumerable#minmax raises a NoMethodError for elements without #<=>"
47
+ fails "Enumerable#minmax raises an ArgumentError when elements are incomparable"
48
+ fails "Enumerable#minmax returns [nil, nil] for an empty Enumerable"
49
+ fails "Enumerable#minmax min should return the minimum element"
50
+
51
+ fails "Enumerable#reverse_each gathers whole arrays as elements when each yields multiple"
52
+
53
+ fails "Enumerable#sort gathers whole arrays as elements when each yields multiple"
54
+ fails "Enumerable#sort raises an error if objects can't be compared"
55
+ fails "Enumerable#sort compare values returned by block with 0"
56
+ fails "Enumerable#sort sorts enumerables that contain nils"
57
+ fails "Enumerable#sort raises a NoMethodError if elements do not define <=>"
58
+ fails "Enumerable#sort yields elements to the provided block"
59
+ fails "Enumerable#sort sorts by the natural order as defined by <=> "
60
+
61
+ fails "Enumerable#zip passes each element of the result array to a block and return nil if a block is given"
62
+ fails "Enumerable#zip converts arguments to arrays using #to_ary"
63
+ fails "Enumerable#zip converts arguments to enums using #to_enum"
64
+ fails "Enumerable#zip gathers whole arrays as elements when each yields multiple"
11
65
  end
@@ -12,6 +12,12 @@ opal_filter "language" do
12
12
  fails "The unpacking splat operator (*) unpacks the start and count arguments in an array slice assignment"
13
13
  fails "The unpacking splat operator (*) unpacks arguments as if they were listed statically"
14
14
 
15
+ fails "The BEGIN keyword runs in a shared scope"
16
+ fails "The BEGIN keyword accesses variables outside the eval scope"
17
+ fails "The BEGIN keyword must appear in a top-level context"
18
+ fails "The BEGIN keyword runs first in a given code unit"
19
+ fails "The BEGIN keyword runs multiple begins in FIFO order"
20
+
15
21
  fails "A block arguments with _ assigns the first variable named"
16
22
  fails "A block arguments with _ extracts arguments with _"
17
23
  fails "A block taking |*a| arguments does not call #to_ary to convert a single yielded object to an Array"
@@ -73,9 +79,6 @@ opal_filter "language" do
73
79
  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"
74
80
  fails "Executing break from within a block returns from the original invoking method even in case of chained calls"
75
81
 
76
- fails "The 'case'-construct lets you define a method after the case statement"
77
- fails "The 'case'-construct with no target expression evaluates true as only 'true' when true is the first clause"
78
-
79
82
  fails "A class variable can be accessed from a subclass"
80
83
  fails "A class variable is set in the superclass"
81
84
  fails "A class variable defined in a module can be accessed from classes that extend the module"
@@ -100,6 +103,27 @@ opal_filter "language" do
100
103
  fails "A class definition stores instance variables defined in the class body in the class object"
101
104
  fails "Reopening a class adds new methods to subclasses"
102
105
 
106
+ fails "Constant resolution within methods with ||= assignes constant if previously undefined"
107
+ fails "Constant resolution within methods with dynamically assigned constants does not search the lexical scope of qualifying modules"
108
+ fails "Constant resolution within methods with dynamically assigned constants returns the updated value when a constant is reassigned"
109
+ fails "Constant resolution within methods with dynamically assigned constants searches Object as a lexical scope only if Object is explicitly opened"
110
+ fails "Constant resolution within methods with dynamically assigned constants searches the superclass chain"
111
+ fails "Constant resolution within methods with dynamically assigned constants searches a module included in the superclass"
112
+ fails "Constant resolution within methods with dynamically assigned constants searches the superclass before a module included in the superclass"
113
+ fails "Constant resolution within methods with statically assigned constants does not search the lexical scope of qualifying modules"
114
+ fails "Constant resolution within methods with statically assigned constants searches Object as a lexical scope only if Object is explicitly opened"
115
+ fails "Constant resolution within methods with statically assigned constants searches the lexical scope of the method not the receiver's immediate class"
116
+ fails "Constant resolution within methods sends #const_missing to the original class or module scope"
117
+ fails "Literal (A::X) constant resolution with dynamically assigned constants evaluates the right hand side before evaluating a constant path"
118
+ fails "Literal (A::X) constant resolution with dynamically assigned constants does not search the singleton class of the class or module"
119
+ fails "Literal (A::X) constant resolution with dynamically assigned constants searches the superclass chain"
120
+ fails "Literal (A::X) constant resolution with dynamically assigned constants searches a module included in the superclass"
121
+ fails "Literal (A::X) constant resolution with dynamically assigned constants searches the superclass before a module included in the superclass"
122
+ fails "Literal (A::X) constant resolution with dynamically assigned constants searches a module included in the immediate class before the superclass"
123
+ fails "Literal (A::X) constant resolution with statically assigned constants does not search the singleton class of the class or module"
124
+ fails "Literal (A::X) constant resolution raises a TypeError if a non-class or non-module qualifier is given"
125
+
126
+
103
127
  fails "The def keyword within a closure looks outside the closure for the visibility"
104
128
  fails "a method definition that sets more than one default parameter all to the same value treats the argument after the multi-parameter normally"
105
129
  fails "a method definition that sets more than one default parameter all to the same value only allows overriding the default value of the first such parameter in each set"
@@ -125,6 +149,13 @@ opal_filter "language" do
125
149
 
126
150
  fails "The defined? keyword for a scoped constant returns nil when an undefined constant is scoped to a defined constant"
127
151
  fails "The defined? keyword for a top-level scoped constant returns nil when an undefined constant is scoped to a defined constant"
152
+ fails "The defined? keyword for an expression with logical connectives returns nil for an expression with 'not' and an unset instance variable"
153
+ fails "The defined? keyword for an expression with logical connectives returns nil for an expression with 'not' and an unset global variable"
154
+ fails "The defined? keyword for an expression with logical connectives returns nil for an expression with '!' and an unset instance variable"
155
+ fails "The defined? keyword for an expression with logical connectives returns nil for an expression with '!' and an unset global variable"
156
+ fails "The defined? keyword for an expression with logical connectives returns nil for an expression with 'not' and an unset class variable"
157
+ fails "The defined? keyword for an expression with logical connectives returns nil for an expression with '!' and an unset class variable"
158
+ fails "The defined? keyword for variables returns nil for a global variable that has been read but not assigned to"
128
159
 
129
160
  fails "An ensure block inside a begin block is executed even when a symbol is thrown in it's corresponding begin block"
130
161
  fails "An ensure block inside a method is executed even when a symbol is thrown in the method"
@@ -161,6 +192,9 @@ opal_filter "language" do
161
192
  fails "The if expression with a boolean range ('flip-flop' operator) mimics an awk conditional with a many-element inclusive-end range"
162
193
  fails "The if expression with a boolean range ('flip-flop' operator) mimics an awk conditional with a single-element inclusive-end range"
163
194
 
195
+ fails "The !~ operator evaluates as a call to !~"
196
+ fails "The =~ operator calls the =~ method"
197
+
164
198
  fails "calling methods on the metaclass calls a method defined on the metaclass of the metaclass"
165
199
  fails "calling methods on the metaclass calls a method in deeper chains of metaclasses"
166
200
  fails "A constant on a metaclass is preserved when the object is cloned"
@@ -0,0 +1,93 @@
1
+ opal_filter "Math" do
2
+ fails "Math.erf returns a float"
3
+ fails "Math.erf returns the error function of the argument"
4
+ fails "Math.erf raises a TypeError if the argument cannot be coerced with Float()"
5
+ fails "Math.erf returns NaN given NaN"
6
+ fails "Math.erf raises a TypeError if the argument is nil"
7
+ fails "Math.erf accepts any argument that can be coerced with Float()"
8
+ fails "Math#erf is accessible as a private instance method"
9
+
10
+ fails "Math.frexp returns the normalized fraction and exponent"
11
+ fails "Math.frexp raises a TypeError if the argument cannot be coerced with Float()"
12
+ fails "Math.frexp returns NaN given NaN"
13
+ fails "Math.frexp raises a TypeError if the argument is nil"
14
+ fails "Math.frexp accepts any argument that can be coerced with Float()"
15
+ fails "Math#frexp is accessible as a private instance method"
16
+
17
+ fails "Math.erfc returns a float"
18
+ fails "Math.erfc returns the complimentary error function of the argument"
19
+ fails "Math.erfc raises a TypeError if the argument cannot be coerced with Float()"
20
+ fails "Math.erfc returns NaN given NaN"
21
+ fails "Math.erfc raises a TypeError if the argument is nil"
22
+ fails "Math.erfc accepts any argument that can be coerced with Float()"
23
+ fails "Math#erfc is accessible as a private instance method"
24
+
25
+ fails "Math.ldexp returns a float"
26
+ fails "Math.ldexp returns the argument multiplied by 2**n"
27
+ fails "Math.ldexp raises a TypeError if the first argument cannot be coerced with Float()"
28
+ fails "Math.ldexp returns NaN given NaN"
29
+ 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()"
31
+ fails "Math.ldexp raises a TypeError if the first argument is nil"
32
+ fails "Math.ldexp raises a TypeError if the second argument is nil"
33
+ fails "Math.ldexp accepts any first argument that can be coerced with Float()"
34
+ fails "Math.ldexp accepts any second argument that can be coerced with Integer()"
35
+ fails "Math#ldexp is accessible as a private instance method"
36
+
37
+ fails "Math.cbrt returns a float"
38
+ fails "Math.cbrt returns the cubic root of the argument"
39
+ fails "Math.cbrt raises a TypeError if the argument cannot be coerced with Float()"
40
+ fails "Math.cbrt raises a TypeError if the argument is nil"
41
+ fails "Math.cbrt accepts any argument that can be coerced with Float()"
42
+
43
+ fails "Math.gamma returns +infinity given 0"
44
+ fails "Math.gamma returns -infinity given -0.0"
45
+ fails "Math.gamma returns Math.sqrt(Math::PI) given 0.5"
46
+ fails "Math.gamma returns exactly 1! given 2"
47
+ fails "Math.gamma returns exactly 2! given 3"
48
+ fails "Math.gamma returns exactly 3! given 4"
49
+ fails "Math.gamma returns exactly 4! given 5"
50
+ fails "Math.gamma returns exactly 5! given 6"
51
+ fails "Math.gamma returns exactly 6! given 7"
52
+ fails "Math.gamma returns exactly 7! given 8"
53
+ fails "Math.gamma returns exactly 8! given 9"
54
+ fails "Math.gamma returns exactly 9! given 10"
55
+ fails "Math.gamma returns exactly 10! given 11"
56
+ fails "Math.gamma returns exactly 11! given 12"
57
+ fails "Math.gamma returns exactly 12! given 13"
58
+ fails "Math.gamma returns exactly 13! given 14"
59
+ fails "Math.gamma returns exactly 14! given 15"
60
+ fails "Math.gamma returns exactly 15! given 16"
61
+ fails "Math.gamma returns exactly 16! given 17"
62
+ fails "Math.gamma returns exactly 17! given 18"
63
+ fails "Math.gamma returns exactly 18! given 19"
64
+ fails "Math.gamma returns exactly 19! given 20"
65
+ fails "Math.gamma returns exactly 20! given 21"
66
+ fails "Math.gamma returns exactly 21! given 22"
67
+ fails "Math.gamma returns exactly 22! given 23"
68
+ fails "Math.gamma returns approximately 23! given 24"
69
+ fails "Math.gamma returns approximately 24! given 25"
70
+ fails "Math.gamma returns approximately 25! given 26"
71
+ fails "Math.gamma returns approximately 26! given 27"
72
+ fails "Math.gamma returns approximately 27! given 28"
73
+ fails "Math.gamma returns approximately 28! given 29"
74
+ fails "Math.gamma returns approximately 29! given 30"
75
+ fails "Math.gamma returns good numerical approximation for gamma(3.2)"
76
+ fails "Math.gamma returns good numerical approximation for gamma(-2.15)"
77
+ fails "Math.gamma returns good numerical approximation for gamma(0.00001)"
78
+ fails "Math.gamma returns good numerical approximation for gamma(-0.00001)"
79
+ fails "Math.gamma raises Math::DomainError given -1"
80
+ fails "Math.gamma returns +infinity given +infinity"
81
+ fails "Math.gamma raises Math::DomainError given negative infinity"
82
+ fails "Math.gamma returns NaN given NaN"
83
+
84
+ fails "Math.lgamma returns [Infinity, 1] when passed 0"
85
+ fails "Math.lgamma returns [Infinity, 1] when passed -1"
86
+ fails "Math.lgamma returns [log(sqrt(PI)), 1] when passed 0.5"
87
+ fails "Math.lgamma returns [log(2/3*PI, 1] when passed 6.0"
88
+ fails "Math.lgamma returns an approximate value when passed -0.5"
89
+ fails "Math.lgamma returns an approximate value when passed -1.5"
90
+ fails "Math.lgamma raises Math::DomainError when passed -Infinity"
91
+ fails "Math.lgamma returns [Infinity, 1] when passed Infinity"
92
+ fails "Math.lgamma returns [NaN, 1] when passed NaN"
93
+ end
@@ -0,0 +1,7 @@
1
+ opal_filter "nil" do
2
+ fails "NilClass#to_r returns 0/1"
3
+ fails "NilClass#to_c returns Complex(0, 0)"
4
+ fails "NilClass#rationalize raises ArgumentError when passed more than one argument"
5
+ fails "NilClass#rationalize ignores a single argument"
6
+ fails "NilClass#rationalize returns 0/1"
7
+ end
@@ -0,0 +1,19 @@
1
+ opal_filter "Fixnum bugs" do
2
+ fails "Integer#downto [stop] when self and stop are Fixnums raises a ArgumentError for invalid endpoints"
3
+
4
+ fails "Fixnum#to_s when no base given returns self converted to a String using base 10"
5
+
6
+ fails "Fixnum#zero? returns true if self is 0"
7
+ end
8
+
9
+ opal_filter "Fixnum#<< doesn't handle non-integers" do
10
+ fails "Fixnum#<< with n << m raises a TypeError when passed a String"
11
+ fails "Fixnum#<< with n << m raises a TypeError when passed nil"
12
+ fails "Fixnum#<< with n << m raises a TypeError when #to_int does not return an Integer"
13
+ fails "Fixnum#<< with n << m returns a Bignum == fixnum_min() * 2 when fixnum_min() << 1 and n < 0"
14
+ fails "Fixnum#<< with n << m returns a Bignum == fixnum_max() * 2 when fixnum_max() << 1 and n > 0"
15
+ fails "Fixnum#<< with n << m returns 0 when m < 0 and m is a Bignum"
16
+ fails "Fixnum#<< with n << m returns 0 when m < 0 and m == p where 2**p > n >= 2**(p-1)"
17
+ fails "Fixnum#<< with n << m returns n shifted right m bits when n < 0, m < 0"
18
+ fails "Fixnum#<< with n << m returns n shifted right m bits when n > 0, m < 0"
19
+ end
@@ -0,0 +1,12 @@
1
+ opal_filter "Opal bugs" do
2
+ fails "Array#join raises a NoMethodError if an element does not respond to #to_str, #to_ary, or #to_s"
3
+
4
+ # arity checking bugs
5
+ fails "Array#shift passed a number n as an argument raises an ArgumentError if more arguments are passed"
6
+ fails "Array#pop passed a number n as an argument raises an ArgumentError if more arguments are passed"
7
+
8
+ # lacking regexp conversion
9
+ fails "String#index with Regexp supports \\G which matches at the given start offset"
10
+ fails "String#index with Regexp starts the search at the given offset"
11
+ fails "String#index with Regexp returns the index of the first match of regexp"
12
+ end
@@ -1,7 +1,5 @@
1
1
  opal_filter "RegExp" do
2
2
  fails "Regexp#~ matches against the contents of $_"
3
- fails "Regexp#match when passed a block returns the block result"
4
- fails "Regexp#match when passed a block yields the MatchData"
5
3
  fails "Regexp#match uses the start as a character offset"
6
4
  fails "Regexp#match matches the input at a given position"
7
5
  end
@@ -1,42 +1,340 @@
1
1
  opal_filter "String" do
2
- fails "String#capitalize is locale insensitive (only upcases a-z and only downcases A-Z)"
2
+ fails "String#=== ignores subclass differences"
3
+ fails "String#=== returns false if obj does not respond to to_str"
4
+ fails "String#=== returns obj == self if obj responds to to_str"
5
+ fails "String#=== returns obj == self if obj responds to to_str"
3
6
 
4
- fails "String#center with length, padding raises an ArgumentError if padstr is empty"
5
- fails "String#center with length, padding raises a TypeError when padstr can't be converted to a string"
6
- fails "String#center with length, padding calls #to_str to convert padstr to a String"
7
- fails "String#center with length, padding raises a TypeError when length can't be converted to an integer"
8
- fails "String#center with length, padding calls #to_int to convert length to an integer"
9
- fails "String#center with length, padding pads with whitespace if no padstr is given"
10
- fails "String#center with length, padding returns a new string of specified length with self centered and padded with padstr"
7
+ fails "String#=~ raises a TypeError if a obj is a string"
11
8
 
12
- fails "String#downcase is locale insensitive (only replaces A-Z)"
9
+ fails "String#[] calls to_int on the given index"
10
+ fails "String#[] calls to_int on the given index"
11
+ fails "String#[] raises a TypeError if the given index is nil"
12
+ fails "String#[] raises a TypeError if the given index can't be converted to an Integer"
13
+ fails "String#[] with index, length returns nil if the length is negative"
14
+ fails "String#[] with index, length calls to_int on the given index and the given length"
15
+ fails "String#[] with index, length calls to_int on the given index and the given length"
16
+ fails "String#[] with index, length raises a TypeError when idx or length can't be converted to an integer"
17
+ fails "String#[] with index, length raises a TypeError when the given index or the given length is nil"
18
+ fails "String#[] with Range returns nil if the beginning of the range falls outside of self"
19
+ fails "String#[] with Range calls to_int on range arguments"
20
+ fails "String#[] with Range calls to_int on range arguments"
21
+ fails "String#[] with Range handles repeated application"
22
+ fails "String#[] with Regexp returns the matching portion of self"
23
+ fails "String#[] with Regexp returns nil if there is no match"
24
+ fails "String#[] with Regexp sets $~ to MatchData when there is a match and nil when there's none"
25
+ fails "String#[] with Regexp, index returns the capture for the given index"
26
+ fails "String#[] with Regexp, index returns nil if there is no match"
27
+ fails "String#[] with Regexp, index returns nil if there is no capture for the given index"
28
+ fails "String#[] with Regexp, index calls to_int on the given index"
29
+ fails "String#[] with Regexp, index calls to_int on the given index"
30
+ fails "String#[] with Regexp, index raises a TypeError when the given index can't be converted to Integer"
31
+ fails "String#[] with Regexp, index raises a TypeError when the given index is nil"
32
+ fails "String#[] with Regexp, index sets $~ to MatchData when there is a match and nil when there's none"
33
+ fails "String#[] with String returns other_str if it occurs in self"
34
+ fails "String#[] with String returns nil if there is no match"
35
+ fails "String#[] with String doesn't call to_str on its argument"
36
+ fails "String#[] with String returns a subclass instance when given a subclass instance"
37
+
38
+ fails "String#dup does not copy constants defined in the singleton class"
13
39
 
14
40
  fails "String#end_with? converts its argument using :to_str"
15
41
  fails "String#end_with? returns true if other is empty"
16
42
 
43
+ fails "String#each_line passes self as a whole to the block if the separator is nil"
44
+ fails "String#each_line yields paragraphs (broken by 2 or more successive newlines) when passed ''"
45
+ fails "String#each_line uses $/ as the separator when none is given"
46
+ fails "String#each_line yields subclass instances for subclasses"
47
+ fails "String#each_line tries to convert the separator to a string using to_str"
48
+ fails "String#each_line tries to convert the separator to a string using to_str"
49
+ fails "String#each_line does not care if the string is modified while substituting"
50
+ fails "String#each_line raises a TypeError when the separator can't be converted to a string"
51
+ fails "String#each_line accept string separator"
52
+ fails "String#each_line raises a TypeError when the separator is a symbol"
53
+ fails "String#each_line returns an enumerator when no block given"
54
+
55
+ fails "String#gsub with pattern and replacement inserts the replacement around every character when the pattern collapses"
56
+ fails "String#gsub with pattern and replacement respects $KCODE when the pattern collapses"
57
+ fails "String#gsub with pattern and replacement doesn't freak out when replacing ^"
58
+ fails "String#gsub with pattern and replacement returns a copy of self with all occurrences of pattern replaced with replacement"
59
+ fails "String#gsub with pattern and replacement supports \\G which matches at the beginning of the remaining (non-matched) string"
60
+ fails "String#gsub with pattern and replacement replaces \\1 sequences with the regexp's corresponding capture"
61
+ fails "String#gsub with pattern and replacement treats \\1 sequences without corresponding captures as empty strings"
62
+ fails "String#gsub with pattern and replacement replaces \\& and \\0 with the complete match"
63
+ fails "String#gsub with pattern and replacement replaces \\` with everything before the current match"
64
+ fails "String#gsub with pattern and replacement replaces \\' with everything after the current match"
65
+ fails "String#gsub with pattern and replacement replaces \\+ with the last paren that actually matched"
66
+ fails "String#gsub with pattern and replacement treats \\+ as an empty string if there was no captures"
67
+ fails "String#gsub with pattern and replacement maps \\\\ in replacement to \\"
68
+ fails "String#gsub with pattern and replacement handles pattern collapse without $KCODE"
69
+ fails "String#gsub with pattern and replacement raises a TypeError when replacement can't be converted to a string"
70
+ fails "String#gsub with pattern and replacement sets $~ to MatchData of last match and nil when there's none"
71
+ fails "String#gsub with pattern and Hash returns a copy of self with all occurrences of pattern replaced with the value of the corresponding hash key"
72
+ fails "String#gsub with pattern and Hash ignores keys that don't correspond to matches"
73
+ fails "String#gsub with pattern and Hash returns an empty string if the pattern matches but the hash specifies no replacements"
74
+ fails "String#gsub with pattern and Hash ignores non-String keys"
75
+ fails "String#gsub with pattern and Hash uses a key's value as many times as needed"
76
+ fails "String#gsub with pattern and Hash uses the hash's default value for missing keys"
77
+ fails "String#gsub with pattern and Hash coerces the hash values with #to_s"
78
+ fails "String#gsub with pattern and Hash coerces the hash values with #to_s"
79
+ fails "String#gsub with pattern and Hash uses the hash's value set from default_proc for missing keys"
80
+ fails "String#gsub with pattern and Hash sets $~ to MatchData of last match and nil when there's none for access from outside"
81
+ fails "String#gsub with pattern and Hash doesn't interpolate special sequences like \\1 for the block's return value"
82
+ fails "String#gsub with pattern and block sets $~ for access from the block"
83
+ fails "String#gsub with pattern and block restores $~ after leaving the block"
84
+ fails "String#gsub with pattern and block sets $~ to MatchData of last match and nil when there's none for access from outside"
85
+
17
86
  fails "String#index raises a TypeError if passed a Symbol"
18
- # we need regexp rewriting for these
19
- fails "String#index with Regexp supports \\G which matches at the given start offset"
20
- fails "String#index with Regexp starts the search at the given offset"
21
- fails "String#index with Regexp returns the index of the first match of regexp"
22
87
 
23
88
  fails "String#intern does not special case certain operators"
24
89
  fails "String#intern special cases +(binary) and -(binary)"
25
90
 
26
- fails "String#length returns the length of self"
27
-
28
91
  fails "String#lines should split on the default record separator and return enumerator if not block is given"
92
+ fails "String#lines splits using default newline separator when none is specified"
93
+ fails "String#lines splits self using the supplied record separator and passes each substring to the block"
94
+ fails "String#lines passes self as a whole to the block if the separator is nil"
95
+ fails "String#lines yields paragraphs (broken by 2 or more successive newlines) when passed ''"
96
+ fails "String#lines yields subclass instances for subclasses"
97
+ fails "String#lines returns self"
98
+ fails "String#lines tries to convert the separator to a string using to_str"
99
+ fails "String#lines tries to convert the separator to a string using to_str"
100
+ fails "String#lines does not care if the string is modified while substituting"
101
+ fails "String#lines raises a TypeError when the separator can't be converted to a string"
102
+ fails "String#lines accept string separator"
103
+ fails "String#lines raises a TypeError when the separator is a symbol"
104
+ fails "String#lines returns an array when no block given"
105
+
106
+ fails "String#lstrip returns a copy of self with leading whitespace removed"
107
+
108
+ fails "String#next returns the successor by increasing the rightmost alphanumeric (digit => digit, letter => letter with same case)"
109
+ fails "String#next increases the next best alphanumeric (jumping over non-alphanumerics) if there is a carry"
110
+ fails "String#next increases the next best character if there is a carry for non-alphanumerics"
111
+ 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
+
113
+ fails "String#partition with String accepts regexp"
114
+ fails "String#partition with String sets global vars if regexp used"
115
+ fails "String#partition with String converts its argument using :to_str"
116
+ fails "String#partition with String converts its argument using :to_str"
117
+ fails "String#partition with String raises error if not convertible to string"
29
118
 
30
- fails "String#size returns the length of self"
119
+ fails "String#rindex with object raises a TypeError if obj isn't a String, Fixnum or Regexp"
120
+ fails "String#rindex with object tries to convert obj to a string via to_str"
121
+ fails "String#rindex with String ignores string subclasses"
122
+ fails "String#rindex with String returns nil if the substring isn't found"
123
+ fails "String#rindex with String raises a TypeError when given offset is nil"
124
+ fails "String#rindex with Regexp behaves the same as String#rindex(string) for escaped string regexps"
125
+ fails "String#rindex with Regexp returns the index of the first match from the end of string of regexp"
126
+ fails "String#rindex with Regexp sets $~ to MatchData of match and nil when there's none"
127
+ fails "String#rindex with Regexp starts the search at the given offset"
128
+ fails "String#rindex with Regexp supports \\G which matches at the given start offset"
129
+ fails "String#rindex with Regexp tries to convert start_offset to an integer via to_int"
130
+ fails "String#rindex with Regexp raises a TypeError when given offset is nil"
131
+
132
+ fails "String#rstrip returns a copy of self with trailing whitespace removed"
133
+ fails "String#rstrip returns a copy of self with all trailing whitespace and NULL bytes removed"
134
+
135
+ fails "String#slice calls to_int on the given index"
136
+ fails "String#slice calls to_int on the given index"
137
+ fails "String#slice raises a TypeError if the given index is nil"
138
+ fails "String#slice raises a TypeError if the given index can't be converted to an Integer"
139
+ fails "String#slice with index, length returns nil if the length is negative"
140
+ fails "String#slice with index, length calls to_int on the given index and the given length"
141
+ fails "String#slice with index, length calls to_int on the given index and the given length"
142
+ fails "String#slice with index, length raises a TypeError when idx or length can't be converted to an integer"
143
+ fails "String#slice with index, length raises a TypeError when the given index or the given length is nil"
144
+ fails "String#slice with Range returns nil if the beginning of the range falls outside of self"
145
+ fails "String#slice with Range calls to_int on range arguments"
146
+ fails "String#slice with Range calls to_int on range arguments"
147
+ fails "String#slice with Range handles repeated application"
148
+ fails "String#slice with Regexp returns the matching portion of self"
149
+ fails "String#slice with Regexp returns nil if there is no match"
150
+ fails "String#slice with Regexp sets $~ to MatchData when there is a match and nil when there's none"
151
+ fails "String#slice with Regexp, index returns the capture for the given index"
152
+ fails "String#slice with Regexp, index returns nil if there is no match"
153
+ fails "String#slice with Regexp, index returns nil if there is no capture for the given index"
154
+ fails "String#slice with Regexp, index calls to_int on the given index"
155
+ fails "String#slice with Regexp, index calls to_int on the given index"
156
+ fails "String#slice with Regexp, index raises a TypeError when the given index can't be converted to Integer"
157
+ fails "String#slice with Regexp, index raises a TypeError when the given index is nil"
158
+ fails "String#slice with Regexp, index sets $~ to MatchData when there is a match and nil when there's none"
159
+ fails "String#slice with String returns other_str if it occurs in self"
160
+ fails "String#slice with String returns nil if there is no match"
161
+ fails "String#slice with String doesn't call to_str on its argument"
162
+ fails "String#slice with String returns a subclass instance when given a subclass instance"
163
+ fails "String#slice with Regexp, group"
164
+
165
+ 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
+ fails "String#split with Regexp respects $KCODE when splitting between characters"
174
+ fails "String#split with Regexp includes all captures in the result array"
175
+ 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
+ fails "String#split with Regexp returns subclass instances based on self"
179
+ fails "String#split with Regexp does not call constructor on created subclass instances"
180
+ fails "String#split with String does not call constructor on created subclass instances"
181
+
182
+ fails "String#squeeze negates sets starting with ^"
183
+ fails "String#squeeze squeezes all chars in a sequence"
184
+ fails "String#squeeze raises an ArgumentError when the parameter is out of sequence"
31
185
 
32
186
  fails "String#start_with? ignores arguments not convertible to string"
33
187
  fails "String#start_with? converts its argument using :to_str"
34
188
 
189
+ fails "String#strip returns a new string with leading and trailing whitespace removed"
190
+ fails "String#strip returns a copy of self with trailing NULL bytes and whitespace"
191
+
192
+ fails "String#sub with pattern, replacement supports \\G which matches at the beginning of the string"
193
+ fails "String#sub with pattern, replacement replaces \\1 sequences with the regexp's corresponding capture"
194
+ fails "String#sub with pattern, replacement treats \\1 sequences without corresponding captures as empty strings"
195
+ fails "String#sub with pattern, replacement replaces \\& and \\0 with the complete match"
196
+ fails "String#sub with pattern, replacement replaces \\` with everything before the current match"
197
+ fails "String#sub with pattern, replacement replaces \\' with everything after the current match"
198
+ fails "String#sub with pattern, replacement replaces \\+ with the last paren that actually matched"
199
+ fails "String#sub with pattern, replacement treats \\+ as an empty string if there was no captures"
200
+ fails "String#sub with pattern, replacement maps \\\\ in replacement to \\"
201
+ fails "String#sub with pattern, replacement tries to convert pattern to a string using to_str"
202
+ fails "String#sub with pattern, replacement tries to convert pattern to a string using to_str"
203
+ fails "String#sub with pattern, replacement raises a TypeError when pattern can't be converted to a string"
204
+ fails "String#sub with pattern, replacement raises a TypeError when replacement can't be converted to a string"
205
+ fails "String#sub with pattern, replacement sets $~ to MatchData of match and nil when there's none"
206
+ fails "String#sub with pattern, replacement replaces \\1 with 1"
207
+ fails "String#sub with pattern, replacement replaces \\\\1 with \\1"
208
+ fails "String#sub with pattern and block sets $~ for access from the block"
209
+ fails "String#sub with pattern and block sets $~ to MatchData of last match and nil when there's none for access from outside"
210
+ fails "String#sub with pattern and block doesn't raise a RuntimeError if the string is modified while substituting"
211
+
212
+ fails "String#succ returns the successor by increasing the rightmost alphanumeric (digit => digit, letter => letter with same case)"
213
+ fails "String#succ increases the next best alphanumeric (jumping over non-alphanumerics) if there is a carry"
214
+ fails "String#succ increases the next best character if there is a carry for non-alphanumerics"
215
+ fails "String#succ adds an additional character (just left to the last increased one) if there is a carry and no character left to increase"
216
+
217
+ fails "String#sum returns a basic n-bit checksum of the characters in self"
218
+ fails "String#sum tries to convert n to an integer using to_int"
219
+ fails "String#sum tries to convert n to an integer using to_int"
220
+ fails "String#sum returns sum of the bytes in self if n less or equal to zero"
221
+
35
222
  fails "String#to_sym does not special case certain operators"
36
223
  fails "String#to_sym special cases +(binary) and -(binary)"
37
224
 
38
- fails "String#upcase is locale insensitive (only replaces a-z)"
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"
227
+ fails "String#tr translates chars not in from_string when it starts with a ^"
228
+ fails "String#tr tries to convert from_str and to_str to strings using to_str"
229
+ fails "String#tr tries to convert from_str and to_str to strings using to_str"
230
+
231
+ fails "String#tr_s translates chars not in from_string when it starts with a ^"
232
+ fails "String#tr_s tries to convert from_str and to_str to strings using to_str"
233
+
234
+ fails "String#sub with pattern, replacement replaces \\\\\\+ with \\\\+"
235
+ fails "String#sub with pattern, replacement replaces \\\\\1 with \\"
236
+ fails "String#sub with pattern, replacement replaces \\\1 with \1"
237
+
238
+ fails "String#casecmp independent of case for non-ASCII characters returns -1 when numerically less than other"
239
+ fails "String#casecmp independent of case for non-ASCII characters returns 1 when numerically greater than other"
240
+
241
+ fails "String#byteslice returns the character code of the character at the given index"
242
+ fails "String#byteslice returns nil if index is outside of self"
243
+ fails "String#byteslice calls to_int on the given index"
244
+ fails "String#byteslice raises a TypeError if the given index is nil"
245
+ fails "String#byteslice raises a TypeError if the given index can't be converted to an Integer"
246
+ fails "String#byteslice with index, length returns the substring starting at the given index with the given length"
247
+ fails "String#byteslice with index, length always taints resulting strings when self is tainted"
248
+ fails "String#byteslice with index, length returns nil if the offset falls outside of self"
249
+ fails "String#byteslice with index, length returns nil if the length is negative"
250
+ fails "String#byteslice with index, length calls to_int on the given index and the given length"
251
+ fails "String#byteslice with index, length raises a TypeError when idx or length can't be converted to an integer"
252
+ fails "String#byteslice with index, length raises a TypeError when the given index or the given length is nil"
253
+ fails "String#byteslice with index, length returns subclass instances"
254
+ fails "String#byteslice with index, length handles repeated application"
255
+ fails "String#byteslice with Range returns the substring given by the offsets of the range"
256
+ fails "String#byteslice with Range returns nil if the beginning of the range falls outside of self"
257
+ fails "String#byteslice with Range returns an empty string if range.begin is inside self and > real end"
258
+ fails "String#byteslice with Range always taints resulting strings when self is tainted"
259
+ fails "String#byteslice with Range returns subclass instances"
260
+ fails "String#byteslice with Range calls to_int on range arguments"
261
+ fails "String#byteslice with Range works with Range subclasses"
262
+ fails "String#byteslice with Range handles repeated application"
263
+
264
+ fails "String#count counts occurrences of chars from the intersection of the specified sets"
265
+ fails "String#count negates sets starting with ^"
266
+ fails "String#count counts all chars in a sequence"
267
+ fails "String#count raises if the given sequences are invalid"
268
+ fails "String#count calls #to_str to convert each set arg to a String"
269
+ fails "String#count raises a TypeError when a set arg can't be converted to a string"
270
+
271
+ fails "String#delete returns a new string with the chars from the intersection of sets removed"
272
+ fails "String#delete raises an ArgumentError when given no arguments"
273
+ fails "String#delete negates sets starting with ^"
274
+ fails "String#delete deletes all chars in a sequence"
275
+ fails "String#delete respects backslash for escaping a -"
276
+ fails "String#delete raises if the given ranges are invalid"
277
+ fails "String#delete taints result when self is tainted"
278
+ fails "String#delete tries to convert each set arg to a string using to_str"
279
+ fails "String#delete raises a TypeError when one set arg can't be converted to a string"
280
+ fails "String#delete returns subclass instances when called on a subclass"
281
+
282
+ fails "String#each_byte returns an enumerator when no block given"
283
+ fails "String#each_byte keeps iterating from the old position (to new string end) when self changes"
284
+ fails "String#each_byte passes each byte in self to the given block"
285
+
286
+ fails "String#== returns obj == self if obj responds to to_str"
287
+ fails "String#== returns false if obj does not respond to to_str"
288
+ fails "String#eql? when given a non-String returns false"
289
+
290
+ fails "String#hex treats leading characters of self as a string of hex digits"
291
+
292
+ fails "String#initialize with an argument raises a RuntimeError on a frozen instance when self-replacing"
293
+ fails "String#initialize with an argument raises a RuntimeError on a frozen instance that is modified"
294
+ fails "String#initialize with an argument raises a TypeError if other can't be converted to string"
295
+ fails "String#initialize with an argument tries to convert other to string using to_str"
296
+ fails "String#initialize with an argument replaces the encoding of self with that of other"
297
+ fails "String#initialize with an argument does not trust self if other is trusted"
298
+ fails "String#initialize with an argument untrusts self if other is untrusted"
299
+ fails "String#initialize with an argument does not untaint self if other is untainted"
300
+ fails "String#initialize with an argument taints self if other is tainted"
301
+ fails "String#initialize with an argument replaces the content of self with other"
302
+ fails "String#initialize with an argument returns self"
303
+ fails "String#initialize with no arguments does not raise an exception when frozen"
304
+ fails "String#initialize is a private method"
305
+
306
+ fails "String#* always taints the result when self is tainted"
307
+ fails "String#* returns subclass instances"
308
+ fails "String#* raises a RangeError when given integer is a Bignum"
309
+ fails "String#* raises an ArgumentError when given integer is negative"
310
+ fails "String#* tries to convert the given argument to an integer using to_int"
311
+
312
+ fails "String.new returns a binary String"
313
+ fails "String.new raises TypeError on inconvertible object"
314
+ fails "String.new is called on subclasses"
315
+ fails "String.new returns an instance of a subclass"
316
+ fails "String.new returns a new string given a string argument"
317
+ fails "String.new returns a fully-formed String"
318
+
319
+ fails "String#+ taints the result when self or other is tainted"
320
+ fails "String#+ when self is in an ASCII-incompatible encoding incompatible with the argument's encoding uses self's encoding if both are empty"
321
+ fails "String#+ when self is in an ASCII-incompatible encoding incompatible with the argument's encoding uses self's encoding if the argument is empty"
322
+ fails "String#+ when self is in an ASCII-incompatible encoding incompatible with the argument's encoding uses the argument's encoding if self is empty"
323
+ fails "String#+ when self is in an ASCII-incompatible encoding incompatible with the argument's encoding raises Encoding::CompatibilityError if neither are empty"
324
+ fails "String#+ when the argument is in an ASCII-incompatible encoding incompatible with self's encoding uses self's encoding if both are empty"
325
+ fails "String#+ when the argument is in an ASCII-incompatible encoding incompatible with self's encoding uses self's encoding if the argument is empty"
326
+ fails "String#+ when the argument is in an ASCII-incompatible encoding incompatible with self's encoding uses the argument's encoding if self is empty"
327
+ fails "String#+ when the argument is in an ASCII-incompatible encoding incompatible with self's encoding raises Encoding::CompatibilityError if neither are empty"
328
+ fails "String#+ when self and the argument are in different ASCII-compatible encodings uses self's encoding if both are ASCII-only"
329
+ fails "String#+ when self and the argument are in different ASCII-compatible encodings uses self's encoding if the argument is ASCII-only"
330
+ fails "String#+ when self and the argument are in different ASCII-compatible encodings uses the argument's encoding if self is ASCII-only"
331
+ fails "String#+ when self and the argument are in different ASCII-compatible encodings raises Encoding::CompatibilityError if neither are ASCII-only"
332
+ fails "String#+ when self is ASCII-8BIT and argument is US-ASCII uses ASCII-8BIT encoding"
39
333
 
40
- # 1.9.3 => 2.0
41
- fails "String#end_with? ignores arguments not convertible to string"
334
+ fails "String#rpartition with String raises error if not convertible to string"
335
+ fails "String#rpartition with String converts its argument using :to_str"
336
+ fails "String#rpartition with String affects $~"
337
+ fails "String#rpartition with String accepts regexp"
338
+ fails "String#rpartition with String always returns 3 elements"
339
+ fails "String#rpartition with String returns an array of substrings based on splitting on the given string"
42
340
  end