summaryrefslogtreecommitdiff
path: root/test/ruby
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby')
-rw-r--r--test/ruby/test_compile_prism.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/ruby/test_compile_prism.rb b/test/ruby/test_compile_prism.rb
index 043d5d8c0e..33a8b17b99 100644
--- a/test/ruby/test_compile_prism.rb
+++ b/test/ruby/test_compile_prism.rb
@@ -1189,6 +1189,27 @@ a
res
RUBY
+
+ # Bug #21001
+ assert_prism_eval(<<~RUBY)
+ RUN_ARRAY = [1,2]
+
+ MAP_PROC = Proc.new do |&blk|
+ block_results = []
+ RUN_ARRAY.each do |value|
+ block_value = blk.call(value)
+ block_results.push block_value
+ end
+ block_results
+ ensure
+ next block_results
+ end
+
+ MAP_PROC.call do |value|
+ break if value > 1
+ next value
+ end
+ RUBY
end
def test_NextNode