Skip to content

Commit

Permalink
test for loop with default value
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.pugscode.org/pugs@25952 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information
szabgab committed Mar 20, 2009
1 parent 628aa1e commit 21ee055
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion S04-statements/for.t
Expand Up @@ -11,7 +11,7 @@ for statement as possible
=end description

plan 49;
plan 50;

## No foreach
# L<S04/The C<for> statement/"no foreach statement any more">
Expand Down Expand Up @@ -378,6 +378,16 @@ eval_dies_ok('for(0..5) { }','keyword needs at least one whitespace after it');
is $str, " 2 12 0";
}

#?rakudo skip 'default value in variable in for loop'
{
my $str = '';
for 1..5 -> $x, $y = 7 {
$str ~= " " ~ $x*$y;
}
is $str, " 2 12 35";
}


{
my @a = <1 2 3>;
my @b = <4 5 6>;
Expand Down

0 comments on commit 21ee055

Please sign in to comment.