add multiple assignment decomposition test

parent e4ca7065
...@@ -167,13 +167,18 @@ assert('Abbreviated variable assignment as returns') do ...@@ -167,13 +167,18 @@ assert('Abbreviated variable assignment as returns') do
assert_equal 1, Syntax4AbbrVarAsgnAsReturns::A.new.b assert_equal 1, Syntax4AbbrVarAsgnAsReturns::A.new.b
end end
assert('Splat and mass assignment') do assert('Splat and multiple assignment') do
*a = *[1,2,3] *a = *[1,2,3]
b, *c = *[7,8,9] b, *c = *[7,8,9]
assert_equal [1,2,3], a assert_equal [1,2,3], a
assert_equal 7, b assert_equal 7, b
assert_equal [8,9], c assert_equal [8,9], c
(a, b), c = [1,2],3
assert_equal [1,2,3], [a,b,c]
(a, b), c = 1,2,3
assert_equal [1,nil,2], [a,b,c]
end end
assert('Return values of case statements') do assert('Return values of case statements') do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment