diff options
| author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-03-24 16:10:40 +0000 |
|---|---|---|
| committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-03-24 16:10:40 +0000 |
| commit | 03ec1e8eb879f93cb94c148d25d4986b2ed60c9a (patch) | |
| tree | c370a47d5c9e763ae974af85ed0df8e318c48b78 /test/ruby | |
| parent | 8b5f0528a7b0b4740708e2e5b74e1e0c79eab45f (diff) | |
merge revision(s) 39627: [Backport #8008]
* compile.c (iseq_compile_each): pass keyword arguments to zsuper,
with current values. [ruby-core:53114] [Bug #8008]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_0_0@39914 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_super.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/ruby/test_super.rb b/test/ruby/test_super.rb index 9505dccdd1..98cf43b7a1 100644 --- a/test/ruby/test_super.rb +++ b/test/ruby/test_super.rb @@ -7,6 +7,7 @@ class TestSuper < Test::Unit::TestCase def double(a, b) [a,b] end def array(*a) a end def optional(a = 0) a end + def keyword(**a) a end end class Single1 < Base def single(*) super end @@ -50,6 +51,18 @@ class TestSuper < Test::Unit::TestCase class Optional5 < Base def array(a = 1, b = 2, *) super end end + class Keyword1 < Base + def keyword(foo: "keyword1") super end + end + class Keyword2 < Base + def keyword(foo: "keyword2") + foo = "changed1" + x = super + foo = "changed2" + y = super + [x, y] + end + end def test_single1 assert_equal(1, Single1.new.single(1)) @@ -112,6 +125,14 @@ class TestSuper < Test::Unit::TestCase assert_equal([9, 8], Optional5.new.array(9, 8)) assert_equal([9, 8, 7], Optional5.new.array(9, 8, 7)) end + def test_keyword1 + assert_equal({foo: "keyword1"}, Keyword1.new.keyword) + bug8008 = '[ruby-core:53114] [Bug #8008]' + assert_equal({foo: bug8008}, Keyword1.new.keyword(foo: bug8008)) + end + def test_keyword2 + assert_equal([{foo: "changed1"}, {foo: "changed2"}], Keyword2.new.keyword) + end class A def tt(aa) |
