Skip to content

Commit

Permalink
[TODO FUDGE] repeat inside sub inside a loop executes
Browse files Browse the repository at this point in the history
...even when condition is false.

RT#128596
  • Loading branch information
zoffixznet committed Jul 12, 2016
1 parent c079c6d commit 9236d81
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion S04-statements/repeat.t
Expand Up @@ -2,7 +2,7 @@ use v6;

use Test;

plan 19;
plan 20;

# L<S04/The C<repeat> statement/"more Pascal-like repeat loop">

Expand Down Expand Up @@ -131,4 +131,15 @@ plan 19;
throws-like 'repeat { "but I myself" }', X::Syntax::Missing, what => '"while" or "until"';
}

# RT #128596
#?rakudo todo 'RT 128596'
{
my $runs = 0;
my sub foo { repeat { $runs++; } while 0; };
foo for ^2;

ok $runs == 2,
'repeat inside sub inside a loop executes even when condition is false';
}

# vim: ft=perl6

0 comments on commit 9236d81

Please sign in to comment.