summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_compile_prism.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ruby/test_compile_prism.rb b/test/ruby/test_compile_prism.rb
index fd5787e467..f54097ab66 100644
--- a/test/ruby/test_compile_prism.rb
+++ b/test/ruby/test_compile_prism.rb
@@ -425,6 +425,15 @@ module Prism
hash
CODE
+ # Test with keyword arguments
+ assert_prism_eval(<<~RUBY)
+ h = Object.new
+ def h.[](**b) = 0
+ def h.[]=(*a, **b); end
+
+ h[foo: 1] ||= 2
+ RUBY
+
# Test with keyword splat
assert_prism_eval(<<~RUBY)
h = Object.new