Replace R-assignment by single-line pattern matching.

Since `R-assignment` in CRuby is abandoned.  Single-line pattern matching
in `mruby` only matches single local variable at the moment. Currently
it works as a right assignment to a local variable. It will be enhanced
in the future.
This commit is contained in:
Yukihiro "Matz" Matsumoto
2020-10-31 19:45:17 +09:00
parent 70ee936367
commit dc886873bc
4 changed files with 3056 additions and 3178 deletions
+1 -5
View File
@@ -345,13 +345,9 @@ assert('splat object in assignment') do
assert_equal [2], (a = *o)
end
assert('right-ward assignment') do
assert('one-line pattern match') do
1 => a
assert_equal(1, a)
13.divmod(5) => a,b
assert_equal([2,3], [a, b])
13.divmod(5) => a,b => c, d
assert_equal([2,3,2,3], [a, b, c, d])
end
assert('splat object in case statement') do