From 06c7ede25923582b7f61c85920cd195b3c0447ce Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 1 Jun 2013 08:21:39 +0000 Subject: vm_insnhelper.c: extract keyword arguments after splat * vm_insnhelper.c (vm_yield_setup_block_args): split single parameter if any keyword arguments exist, and then extract keyword arguments. [ruby-core:55203] [Bug #8463] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41020 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_keyword.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'test/ruby/test_keyword.rb') diff --git a/test/ruby/test_keyword.rb b/test/ruby/test_keyword.rb index ed1f79cfd3..4ff7c40321 100644 --- a/test/ruby/test_keyword.rb +++ b/test/ruby/test_keyword.rb @@ -263,9 +263,14 @@ class TestKeywordArguments < Test::Unit::TestCase def test_rest_keyrest bug7665 = '[ruby-core:51278]' + bug8463 = '[ruby-core:55203] [Bug #8463]' expect = [*%w[foo bar], {zzz: 42}] assert_equal(expect, rest_keyrest(*expect), bug7665) - assert_equal(expect, proc {|*args, **opt| next *args, opt}.call(*expect), bug7665) + pr = proc {|*args, **opt| next *args, opt} + assert_equal(expect, pr.call(*expect), bug7665) + assert_equal(expect, pr.call(expect), bug8463) + pr = proc {|a, *b, **opt| next a, *b, opt} + assert_equal(expect, pr.call(expect), bug8463) end def test_bare_kwrest -- cgit v1.2.3