mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Merge branch 'failing-multiple-assignments-with-rest-tests' of https://github.com/cremno/mruby into cremno-failing-multiple-assignments-with-rest-tests
This commit is contained in:
@@ -219,6 +219,21 @@ assert('Splat without assignment') do
|
||||
assert_equal 1, a
|
||||
end
|
||||
|
||||
assert('multiple assignment (rest)') do
|
||||
*a = 0
|
||||
assert_equal [0], a
|
||||
end
|
||||
|
||||
assert('multiple assignment (rest+post)') do
|
||||
*a, b = 0, 1, 2
|
||||
*c, d = 3
|
||||
|
||||
assert_equal [0, 1], a
|
||||
assert_equal [2], b
|
||||
assert_equal [], c
|
||||
assert_equal [3], d
|
||||
end
|
||||
|
||||
assert('Return values of case statements') do
|
||||
a = [] << case 1
|
||||
when 3 then 2
|
||||
|
||||
Reference in New Issue
Block a user