Skip to content

Commit

Permalink
Test all regex blocks update $/
Browse files Browse the repository at this point in the history
  • Loading branch information
zoffixznet committed Sep 21, 2017
1 parent 63181b3 commit c8a7565
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion S05-match/positions.t
Expand Up @@ -8,7 +8,7 @@ version 0.3 (12 Apr 2004), file t/pos.t.
=end pod

plan 12;
plan 13;

my $str = "abrAcadAbbra";

Expand All @@ -33,4 +33,17 @@ is ('abc' ~~ /\d+/), Nil, 'Failed match returns Nil';
is-deeply $/.to, 6, 'List.to';
}

# RT #126249
subtest '$/ is constructed in all blocks inside regexes' => {
plan 2;
my @res;
my token foo {
{ @res.push: $/.to }
abc { @res.push: $/.to }
123 { @res.push: $/.to }
};
ok "abc123" ~~ /<foo>/, 'regex matched';
is-deeply @res, [0, 3, 6], 'blocks returned correct $/.to values';
}

# vim: ft=perl6

0 comments on commit c8a7565

Please sign in to comment.