diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-12-14 08:39:17 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-12-14 08:39:17 +0000 |
commit | 91afce9afa0033bf9835e70207306f3715fd69f7 (patch) | |
tree | 42b7207677bcc02abde33716258e2e25cfcf06e6 /test/ruby/test_keyword.rb | |
parent | 1ec457c2ff6c52f16eab408cc4e4990414fff940 (diff) | |
download | ruby-91afce9afa0033bf9835e70207306f3715fd69f7.tar.gz |
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
Diffstat (limited to 'test/ruby/test_keyword.rb')
-rw-r--r-- | test/ruby/test_keyword.rb | 10 |
1 files changed, 10 insertions, 0 deletions
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{ |