Skip to content

Commit

Permalink
Add test for RT #130529
Browse files Browse the repository at this point in the history
  • Loading branch information
usev6 committed Jan 9, 2017
1 parent 685da70 commit 90c58ff
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion S32-list/grep.t
Expand Up @@ -9,7 +9,7 @@ built-in grep tests
=end pod

plan 42;
plan 44;

my @list = (1 .. 10);

Expand Down Expand Up @@ -73,6 +73,18 @@ my @list = (1 .. 10);
# RT #130365
is (^Inf).grep({last if $_ > 5; True}).eager.join, '012345',
'last in grep on infinite list';
# RT #130529
{
my $retries = 0;
is (1..5).grep({
if $_ == 3 {
$retries++;
redo unless $retries == 3
};
$_
}).join('|'), '1|2|3|4|5', 'redo works in grep (1)';
is $retries, 3, 'redo works in grep (2)';
}
}

# since the test argument to .grep is a Matcher, we can also
Expand Down

0 comments on commit 90c58ff

Please sign in to comment.