Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Another passing test.
  • Loading branch information
jnthn committed Jan 28, 2013
1 parent 063ec8a commit cd1b7f0
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions t/nqp/47-loop-control.t
@@ -0,0 +1,32 @@
#! nqp

plan(3);

my $runs := 0;

while $runs < 5 {
$runs++;
last if $runs == 3;
}

ok($runs == 3, "last works in while");

$runs := 0;
my $i := 0;
while $runs < 5 {
$runs++;
next if $runs % 2;
$i++;
}

ok($i == 2, "next works in while");

$runs := 0;
$i := 0;
while $i < 5 {
$runs++;
redo if $runs % 2;
$i++;
}

ok($runs == 10, "redo works in while");

0 comments on commit cd1b7f0

Please sign in to comment.