Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

for test

git-svn-id: http://svn.pugscode.org/pugs@25947 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
commit e681f5927dba9730354d2eab6526b9e4a5835685 1 parent 6e27257
szabgab authored
Showing with 21 additions and 1 deletion.
  1. +21 −1 S04-statements/for.t
View
22 S04-statements/for.t
@@ -11,7 +11,7 @@ for statement as possible
=end description
-plan 45;
+plan 47;
## No foreach
# L<S04/The C<for> statement/"no foreach statement any more">
@@ -362,4 +362,24 @@ eval_dies_ok('for(0..5) { }','keyword needs at least one whitespace after it');
is $str, "37", "for loop with two variables";
}
+{
+ #my $str = '';
+ eval_dies_ok('for 1..5 -> $x, $y { $str ~= "$x$y" }', 'Should throw exception StopIteration');
+ #is $str, "1234", "loop ran before throwing exception";
+ #diag ">$str<";
+}
+
+{
+ my @a = <1 2 3>;
+ my @b = <4 5 6>;
+ my $res = '';
+ for @a Z @b -> $x, $y {
+ $res ~= " " ~ $x * $y;
+ }
+ is $res, " 4 10 18", "Z -ed for loop";
+}
+
+
+
+
# vim: ft=perl6
Please sign in to comment.
Something went wrong with that request. Please try again.