diff options
Diffstat (limited to 'test/ruby')
| -rw-r--r-- | test/ruby/test_compile_prism.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/ruby/test_compile_prism.rb b/test/ruby/test_compile_prism.rb index 0998c8fa5d..8f42fb5851 100644 --- a/test/ruby/test_compile_prism.rb +++ b/test/ruby/test_compile_prism.rb @@ -394,6 +394,15 @@ module Prism h[foo: 1] &&= 2 RUBY + + # Test with keyword splat + assert_prism_eval(<<~RUBY) + h = Object.new + def h.[](**b) = 1 + def h.[]=(*a, **b); end + + h[**{}] &&= 2 + RUBY end def test_IndexOrWriteNode @@ -415,6 +424,15 @@ module Prism hash["key", &(Proc.new { _1.upcase })] ||= "value" hash CODE + + # Test with keyword splat + assert_prism_eval(<<~RUBY) + h = Object.new + def h.[](**b) = nil + def h.[]=(*a, **b); end + + h[**{}] ||= 2 + RUBY end def test_IndexOperatorWriteNode |
