diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-11-27 16:21:48 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2014-11-27 16:21:48 +0900 |
| commit | bcf8ad87e6c9a55ba852e483052ba579b5ecae37 (patch) | |
| tree | b2f18eef5287a77cb52f6eaff7fd1bfb8f0c2348 /test/t/syntax.rb | |
| parent | e4ca706530b730d0ada1e2f5e0f4b20b11968012 (diff) | |
| download | mruby-bcf8ad87e6c9a55ba852e483052ba579b5ecae37.tar.gz mruby-bcf8ad87e6c9a55ba852e483052ba579b5ecae37.zip | |
add multiple assignment decomposition test
Diffstat (limited to 'test/t/syntax.rb')
| -rw-r--r-- | test/t/syntax.rb | 7 |
1 files changed, 6 insertions, 1 deletions
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 |
