summaryrefslogtreecommitdiff
path: root/test/ruby/test_keyword.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-08-05 06:58:44 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-08-05 06:58:44 +0000
commit26aed9c5779cadf6d8a2030e4cc25958efbda522 (patch)
treee86f7f48de3660eb536cd32a39a8f58db1425568 /test/ruby/test_keyword.rb
parentd11dfab56911ff3daefc1d9e552ff14b5e53c665 (diff)
splat keyword hash
* compile.c (compile_array_keyword_arg): set keyword splat flag if explicitly splatted. [ruby-core:68124] [Bug #10856] * vm_args.c (setup_parameters_complex): try keyword hash splat if given. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59519 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_keyword.rb')
-rw-r--r--test/ruby/test_keyword.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_keyword.rb b/test/ruby/test_keyword.rb
index 4c99a3212d..c7dd6c88e3 100644
--- a/test/ruby/test_keyword.rb
+++ b/test/ruby/test_keyword.rb
@@ -503,6 +503,17 @@ class TestKeywordArguments < Test::Unit::TestCase
assert_equal([1, 9], m1(1, o, &->(a, k: 0) {break [a, k]}), bug10016)
end
+ def test_splat_hash
+ m = Object.new
+ def m.f() :ok; end
+ o = {a: 1}
+ assert_raise_with_message(ArgumentError, /unknown keyword: a/) {
+ m.f(**o)
+ }
+ o = {}
+ assert_equal(:ok, m.f(**o), '[ruby-core:68124] [Bug #10856]')
+ end
+
def test_gced_object_in_stack
bug8964 = '[ruby-dev:47729] [Bug #8964]'
assert_normal_exit %q{