summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-01 00:14:23 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-01-01 00:14:23 +0000
commit6a37b8cde38465a72991579e660d435faaa006ab (patch)
tree6438de2aea50bea85fb315fded216b80afa1c8ab /test/ruby
parent1026907467ea3d5441e1bfa95f5f37b431a684f3 (diff)
vm_args.c: fix non-symbol keys hash
* 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/trunk@49088 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-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