Skip to content

Commit

Permalink
Add test for RT #118769
Browse files Browse the repository at this point in the history
  • Loading branch information
usev6 committed Oct 22, 2014
1 parent 18a47ab commit 82d502c
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion S04-statement-modifiers/for.t
Expand Up @@ -2,7 +2,7 @@ use v6;

use Test;

plan 21;
plan 23;

# L<S04/"Conditional statements"/Conditional statement modifiers work as in Perl 5>

Expand Down Expand Up @@ -113,4 +113,15 @@ eval_dies_ok '1 for <a b> for <c d>;', 'double statement-modifying for is not al
# RT #89208
is ((sub r { "OH HAI" })() for 5), "OH HAI", 'Anon sub in statement modifier for works.';

# RT #118769
{
my @x = <x x x>;
$_ = 'foo' for @x;
is @x, <foo foo foo>, 'can assign to $_ in a statement_mod "for" loop (1)';

my @y = <& a& &b>;
s:g/\&/\\\&/ for @y;
is @y, ('\&', 'a\&', '\&b'), 'can assign to $_ in a statement_mod "for" loop (2)';
}

# vim: ft=perl6

0 comments on commit 82d502c

Please sign in to comment.