aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_keyword.rb
diff options
context:
space:
mode:
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 a8a609696a..8fe69b44fb 100644
--- a/test/ruby/test_keyword.rb
+++ b/test/ruby/test_keyword.rb
@@ -255,4 +255,15 @@ class TestKeywordArguments < Test::Unit::TestCase
assert_equal(["foo", 111111], m1(num: 111111, &blk))
assert_equal(["bar", 111111], m1(str: "bar", num: 111111, &blk))
end
+
+ def rest_keyrest(*args, **opt)
+ return *args, opt
+ end
+
+ def test_rest_keyrest
+ bug7665 = '[ruby-core:51278]'
+ expect = [*%w[foo bar], {zzz: 42}]
+ assert_equal(expect, rest_keyrest(*expect), bug7665)
+ assert_equal(expect, proc {|*args, **opt| next *args, opt}.call(*expect), bug7665)
+ end
end