Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Tests for RT #111704.
  • Loading branch information
jnthn committed Apr 28, 2015
1 parent 47400f0 commit 8c29100
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
9 changes: 8 additions & 1 deletion S04-statement-modifiers/for.t
Expand Up @@ -2,7 +2,7 @@ use v6;

use Test;

plan 24;
plan 25;

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

Expand Down Expand Up @@ -133,4 +133,11 @@ is ((sub r { "OH HAI" })() for 5), "OH HAI", 'Anon sub in statement modifier for
is @r[0], 'cool', 'for modifies the $_ that is visible to the {} interpolator';
}

# RT #111704
{
my $a = '';
try { $a ~= $_ } for <1 2>;
is $a, '12', 'Correct $_ in try block in statement-modifying for';
}

# vim: ft=perl6
9 changes: 8 additions & 1 deletion S04-statement-modifiers/given.t
Expand Up @@ -2,7 +2,7 @@ use v6;

use Test;

plan 7;
plan 8;

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

Expand Down Expand Up @@ -51,4 +51,11 @@ plan 7;
is @r[0], 'cool', 'given modifies the $_ that is visible to the {} interpolator';
}

# RT #111704
{
my $a = 'many ';
try { $a ~= $_ } given 'pelmeni';
is $a, 'many pelmeni', 'Correct $_ in try block in statement-modifying given';
}

# vim: ft=perl6

0 comments on commit 8c29100

Please sign in to comment.