Permalink
Browse files

test for loop with two varibles

git-svn-id: http://svn.pugscode.org/pugs@25946 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
1 parent dad7535 commit 6e27257662bc681aa917b203c26549090d7f0a25 szabgab committed Mar 20, 2009
Showing with 11 additions and 1 deletion.
  1. +11 −1 S04-statements/for.t
View
@@ -11,7 +11,7 @@ for statement as possible
=end description
-plan 44;
+plan 45;
## No foreach
# L<S04/The C<for> statement/"no foreach statement any more">
@@ -352,4 +352,14 @@ my @elems = <a b c d e>;
#L<S04/"keywords require whitespace">
eval_dies_ok('for(0..5) { }','keyword needs at least one whitespace after it');
+# looping with more than one loop variables
+{
+ my @a = <1 2 3 4>;
+ my $str = '';
+ for @a -> $x, $y {
+ $str ~= $x+$y;
+ }
+ is $str, "37", "for loop with two variables";
+}
+
# vim: ft=perl6

0 comments on commit 6e27257

Please sign in to comment.