summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2024-01-12 10:40:23 -0500
committerPeter Zhu <peter@peterzhu.ca>2024-01-12 13:04:23 -0500
commit0462b1b350b0f86ce4cfebc195fe0f24005d28f4 (patch)
tree221550fb296bafe3f6790ff12d3aa62f034359c2 /test/ruby
parent8b8dcc7af174def5216044019c1d3e42edfdc7cf (diff)
[PRISM] Fix splat in when
Fixes ruby/prism#2147.
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_compile_prism.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_compile_prism.rb b/test/ruby/test_compile_prism.rb
index 7115597903..965f3d3c91 100644
--- a/test/ruby/test_compile_prism.rb
+++ b/test/ruby/test_compile_prism.rb
@@ -767,6 +767,17 @@ module Prism
end
prism_test_case_node
CODE
+
+ # Test splat in when
+ assert_prism_eval(<<~RUBY)
+ ary = [1, 2]
+ case 1
+ when *ary
+ :ok
+ else
+ :ng
+ end
+ RUBY
end
def test_ElseNode