Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
41 lines (32 sloc) 696 Bytes
use v6;
use Test;
plan 4;
# L<S04/"Conditional statements"/Conditional statement modifiers work as in Perl 5>
# test simple the ``until'' statement modifier
{
my $a=0;
$a += 1 until $a >= 10;
is($a, 10, "post until");
}
# test the ``until'' statement modifier
{
my ($a, $b);
$a=0; $b=0;
$a += $b += 1 until $b >= 10;
is($a, 55, "post until");
}
#?pugs skip "cannot shift scalar"
{
my @a = ('a', 'b', 'a');
my $a = 'b';
$a ~= ', ' ~ shift @a until !+@a;
is($a, "b, a, b, a", "post until");
}
#?pugs skip "cannot shift scalar"
{
my @a = 'a'..'e';
my $a = 0;
$a++ until shift(@a) eq 'c';
is($a, 2, "post until");
}
# vim: ft=perl6
Jump to Line
Something went wrong with that request. Please try again.