diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-10-11 04:46:42 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-10-11 04:46:42 +0000 |
commit | 1571682719525d67ae355e4a0394c002f4aa30f1 (patch) | |
tree | 7a430f1db89189d02a0e92664b473906b0d9bc95 /test | |
parent | 81ce0e38535d71e53635354bfab6f64a30d556f0 (diff) | |
download | ruby-1571682719525d67ae355e4a0394c002f4aa30f1.tar.gz |
parse.y: precedence of duplicated keys
* parse.y (assocs): concatenate splatted literal hashes. the
former key has precedence even if duplicated literal keys
follow. [ruby-core:65368] [Bug #10315]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47877 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_syntax.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb index 564a7eab29..013d9dcac3 100644 --- a/test/ruby/test_syntax.rb +++ b/test/ruby/test_syntax.rb @@ -112,6 +112,10 @@ class TestSyntax < Test::Unit::TestCase assert_equal([11, 22], o.kw(k2: 22, **h)) assert_equal([11, 12], o.kw(**h, **{k2: 22})) assert_equal([11, 22], o.kw(**{k2: 22}, **h)) + + bug10315 = '[ruby-core:65368] [Bug #10315]' + assert_equal([22, 2], o.kw(**{k1: 22}, **{k1: 23}), bug10315) + h = {k3: 31} assert_raise(ArgumentError) {o.kw(**h)} h = {"k1"=>11, k2: 12} |