summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2024-01-24 10:22:46 -0500
committerPeter Zhu <peter@peterzhu.ca>2024-01-24 11:41:08 -0500
commit927928badb1a53aae6b29e65627720d7cb6cfdd7 (patch)
treead1c26e7be31994c96b566f4eeb839042cb2309b /test/ruby
parent4220bdba395cff7d4e933b319a186e889ed9b921 (diff)
[PRISM] Fix anonymous keyword arguments
Fixes ruby/prism#2256.
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_compile_prism.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_compile_prism.rb b/test/ruby/test_compile_prism.rb
index 6a30854ba8..5425f2c730 100644
--- a/test/ruby/test_compile_prism.rb
+++ b/test/ruby/test_compile_prism.rb
@@ -825,6 +825,14 @@ module Prism
assert_prism_eval("foo = { a: 1 }; { **foo }")
assert_prism_eval("foo = { a: 1 }; bar = foo; { **foo, b: 2, **bar, c: 3 }")
assert_prism_eval("foo = { a: 1 }; { b: 2, **foo, c: 3}")
+
+ # Test anonymous AssocSplatNode
+ assert_prism_eval(<<~RUBY)
+ o = Object.new
+ def o.bar(**) = Hash(**)
+
+ o.bar(hello: "world")
+ RUBY
end
def test_HashNode