# New Ticket Created by "Sean O'Rourke" # Please include the string: [perl #15009] # in the subject line of all future correspondence about this issue. # <URL: http://bugs6.perl.org/rt2/Ticket/Display.html?id=15009 >
This file is intended to be languages/perl6/t/compiler/5.t. It tests perl6-style "for @xs; @yz -> $x; $y, $z { ... }" loops. Once a few patches get into CVS, all 5 subtests should pass. /s -- attachment 1 ------------------------------------------------------ url: http://bugs6.perl.org/rt2/attach/30027/25481/1fbd81/5.t
#!perl use strict; use P6C::TestCompiler tests => 5; ############################## output_is(<<'CODE', <<'OUT', "For 1 -> 2"); sub main() { my @a = 1..10; for @a -> $a, $b { print1($a); } } CODE 1 3 5 7 9 OUT ############################## output_is(<<'CODE', <<'OUT', "For 1;1 -> 3"); sub main() { my @a = 1..10; for @a ; @a -> $a, $b, $c { print1($a); } } CODE 1 2 4 5 7 8 OUT ############################## output_is(<<'CODE', <<'OUT', "For 1;1 -> 1;1"); sub main() { for 1..10 ; 1..10 -> $a ; $b { print1($a); } } CODE 1 2 3 4 5 6 7 8 9 10 OUT ############################## output_is(<<'CODE', <<'OUT', "For 1;1 -> 1;1 (uneven)"); sub main() { for 1..10 ; 1..5 -> $a; $b { print1($a); } } CODE 1 2 3 4 5 OUT ############################## output_is(<<'CODE', <<'OUT', "For 1;1 -> 1;2"); sub main() { for 1..5 ; 1..10 -> $a; $b, $c { print1($a _ ' ' _ $c); } } CODE 1 2 2 4 3 6 4 8 5 10 OUT