summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-16 05:21:00 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-16 05:21:00 +0000
commit81f257aa10cce69cf2bee38f955f7c22c18e93e1 (patch)
treee9d06e0c1148c679c32aae1a726fe76353c84a89 /test
parentd40ee82b18f3ccc898d7a15a535c6e28cd214f79 (diff)
merge revision(s) 49088: [Backport #10685]
* vm_args.c (keyword_hash_p): fix non-symbol keys hash. rb_extract_keywords() returns 0 not Qnil when no symbol keys is included. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@49273 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_keyword.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_keyword.rb b/test/ruby/test_keyword.rb
index 82d6407fe3..70cdba1db2 100644
--- a/test/ruby/test_keyword.rb
+++ b/test/ruby/test_keyword.rb
@@ -559,4 +559,11 @@ class TestKeywordArguments < Test::Unit::TestCase
assert_equal({:bar => "bar"}, obj.foo, bug10659)
}
end
+
+ def m(a) yield a end
+
+ def test_nonsymbol_key
+ result = m(["a" => 10]) { |a = nil, **b| [a, b] }
+ assert_equal([{"a" => 10}, {}], result)
+ end
end