diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-10-22 00:52:59 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-10-22 00:52:59 +0000 |
commit | f8490b831f4bce969c8b414b91902f253805f6cd (patch) | |
tree | 21dd3bba19b8f6453c4936060b6b1b12f9a7cc11 /test/ruby | |
parent | 1e26cc92a1591cddb1e8df08dcb9c8cb75a3e340 (diff) | |
download | ruby-f8490b831f4bce969c8b414b91902f253805f6cd.tar.gz |
compile.c: order with splatting
* compile.c (setup_args): duplicate splatting array if more
arguments present to obey left-to-right execution order.
[ruby-core:77701] [Bug# 12860]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56469 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_call.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_call.rb b/test/ruby/test_call.rb index fb79eadb64..4496d78210 100644 --- a/test/ruby/test_call.rb +++ b/test/ruby/test_call.rb @@ -90,4 +90,12 @@ class TestCall < Test::Unit::TestCase h[:foo] = nil } end + + def test_call_splat_order + bug12860 = '[ruby-core:77701] [Bug# 12860]' + ary = [1, 2] + assert_equal([1, 2, 1], aaa(*ary, ary.shift), bug12860) + ary = [1, 2] + assert_equal([0, 1, 2, 1], aaa(0, *ary, ary.shift), bug12860) + end end |