Commit 31206f7a

31206f7ac549Merged

Ryan Seys <[email protected]> · 6 months ago · 6 files · +6 added

Description

test: cover redo in zip, step, and cycle blocks

Three tests pinning the Array#zip, Integer#step, and Array#cycle method-iterator wrappings. redo_cycle uses the count-bounded form ([1,2].cycle(2) do ...) so the test terminates without break.

🤖 Generated with Claude Code

Details

Commit
31206f7ac549
Parent
c3af7ad7d5f9

test/redo_cycle.rbaddedView file

1+# RedoNode -- `redo` inside Array#cycle (with a count to terminate).
2+attempts = 0
3+[1, 2].cycle(2) do |x|
4+ attempts += 1
5+ if x == 1 && attempts < 3
6+ redo
7+ end
8+ puts "x=#{x} attempt=#{attempts}"
9+end
10+puts "total=#{attempts}"