Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Extend tests for RT #113904
  • Loading branch information
usev6 committed Oct 22, 2014
1 parent 7896054 commit 0e579ae
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions S02-magicals/dollar-underscore.t
Expand Up @@ -6,7 +6,7 @@ use v6;

use Test;

plan 9;
plan 11;


my @list = ('a');
Expand Down Expand Up @@ -44,7 +44,7 @@ for @list -> $letter {
lives_ok { for @mutable_array { $_++ } }, 'default topic is rw by default';
}

#RT #113904
# RT #113904
{
$_ = 1;
my $tracker = '';
Expand All @@ -56,6 +56,12 @@ for @list -> $letter {

is $tracker, '1 : 1|* : 2',
'Two iterations of a loop share the same $_ if it is not a formal parameter';

## also from RT #113904
lives_ok { $_ = 42; for 1 -> $p { if 1 { "$_" } } },
'no Null PMC access error when outer $_ is used in block of for loop';
lives_ok { $_ = 1; for 12 -> $a { if 1 { $_.WHAT } } },
'$_ in block of for loop is a SixModelObject';
}

{
Expand Down

0 comments on commit 0e579ae

Please sign in to comment.