diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-12-27 09:34:40 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-12-27 09:34:40 +0000 |
commit | a078bbcc172dae52bfd8bf9d25f7736a544972e8 (patch) | |
tree | f1dcd13fe4e177fd967579347ff5c83d1987651a /test | |
parent | 16d03ff2a46dda3dab40caeb794b8a890b024e05 (diff) |
merge revision(s) 56469: [Backport #12860]
* 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/branches/ruby_2_2@57210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-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 5b81eb187a..d5319e7c7c 100644 --- a/test/ruby/test_call.rb +++ b/test/ruby/test_call.rb @@ -31,4 +31,12 @@ class TestCall < Test::Unit::TestCase assert_nothing_raised(ArgumentError) {o.foo} assert_raise_with_message(ArgumentError, e.message, bug9622) {o.foo(100)} 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 |