Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

39 lines (30 sloc) 0.628 kb
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");
}
{
my @a = ('a', 'b', 'a');
my $a = 'b';
$a ~= ', ' ~ shift @a until !+@a;
is($a, "b, a, b, a", "post until");
}
{
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.