From bcf8ad87e6c9a55ba852e483052ba579b5ecae37 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Thu, 27 Nov 2014 16:21:48 +0900 Subject: add multiple assignment decomposition test --- test/t/syntax.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/t/syntax.rb b/test/t/syntax.rb index e105cd3d4..e7a962441 100644 --- a/test/t/syntax.rb +++ b/test/t/syntax.rb @@ -167,13 +167,18 @@ assert('Abbreviated variable assignment as returns') do assert_equal 1, Syntax4AbbrVarAsgnAsReturns::A.new.b end -assert('Splat and mass assignment') do +assert('Splat and multiple assignment') do *a = *[1,2,3] b, *c = *[7,8,9] assert_equal [1,2,3], a assert_equal 7, b 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 assert('Return values of case statements') do -- cgit v1.2.3