From 3032b62d5471e7acefc96f13de24c2ffba33ac19 Mon Sep 17 00:00:00 2001 From: nagachika Date: Mon, 16 Jan 2017 18:59:40 +0000 Subject: 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_3@57342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_call.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/ruby') 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 -- cgit v1.2.3