diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-05-18 07:38:55 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-05-18 07:38:55 +0000 |
commit | e38a2399d21bd8c6f104a1b522a82ae0b75b34de (patch) | |
tree | 66c75d83ffe1c5951cec533eda3722be2e918eee /test/ruby/test_keyword.rb | |
parent | 3e8bba2fc1138fb072935b3f935810a78ce71a8c (diff) | |
download | ruby-e38a2399d21bd8c6f104a1b522a82ae0b75b34de.tar.gz |
compile.c: forward kwrest
* compile.c (iseq_compile_each): forward anonymous and first keyword
rest argument one. [ruby-core:55033] [Bug #8416].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40807 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_keyword.rb')
-rw-r--r-- | test/ruby/test_keyword.rb | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/ruby/test_keyword.rb b/test/ruby/test_keyword.rb index ae56757032..7443937942 100644 --- a/test/ruby/test_keyword.rb +++ b/test/ruby/test_keyword.rb @@ -349,4 +349,34 @@ class TestKeywordArguments < Test::Unit::TestCase assert_equal([42, {:bar=>"x"}], a.new.foo(42), bug8236) assert_equal([42, {:bar=>"x"}], b.new.foo(42), bug8236) end + + def test_zsuper_only_named_kwrest + bug8416 = '[ruby-core:55033] [Bug #8416]' + base = Class.new do + def foo(**h) + h + end + end + a = Class.new(base) do + def foo(**h) + super + end + end + assert_equal({:bar=>"x"}, a.new.foo(bar: "x"), bug8416) + end + + def test_zsuper_only_anonymous_kwrest + bug8416 = '[ruby-core:55033] [Bug #8416]' + base = Class.new do + def foo(**h) + h + end + end + a = Class.new(base) do + def foo(**) + super + end + end + assert_equal({:bar=>"x"}, a.new.foo(bar: "x"), bug8416) + end end |