From 91afce9afa0033bf9835e70207306f3715fd69f7 Mon Sep 17 00:00:00 2001 From: nobu Date: Sat, 14 Dec 2013 08:39:17 +0000 Subject: vm_insnhelper.c: post arguments as mandatory * vm_insnhelper.c (vm_callee_setup_arg_complex): count post arguments as mandatory arguments. [ruby-core:57706] [Bug #8993] * vm_insnhelper.c (vm_yield_setup_block_args): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44207 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_keyword.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test') diff --git a/test/ruby/test_keyword.rb b/test/ruby/test_keyword.rb index e7e1a927e6..7e708454ae 100644 --- a/test/ruby/test_keyword.rb +++ b/test/ruby/test_keyword.rb @@ -401,6 +401,16 @@ class TestKeywordArguments < Test::Unit::TestCase assert_equal([{}, {:bar=>"x"}], a.new.foo({}, bar: "x")) end + def test_precedence_of_keyword_arguments_with_post_argument + bug8993 = '[ruby-core:57706] [Bug #8993]' + a = Class.new do + def foo(a, b, c=1, *d, e, f:2, **g) + [a, b, c, d, e, f, g] + end + end + assert_equal([1, 2, 1, [], {:f=>5}, 2, {}], a.new.foo(1, 2, f:5), bug8993) + end + def test_gced_object_in_stack bug8964 = '[ruby-dev:47729] [Bug #8964]' assert_normal_exit %q{ -- cgit v1.2.3