From 90c58ff0eb3b29f7f0a8744027b3b6f46fca46bb Mon Sep 17 00:00:00 2001 From: usev6 Date: Mon, 9 Jan 2017 23:15:02 +0100 Subject: [PATCH] Add test for RT #130529 --- S32-list/grep.t | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/S32-list/grep.t b/S32-list/grep.t index 70a012b4f7..a338bd739a 100644 --- a/S32-list/grep.t +++ b/S32-list/grep.t @@ -9,7 +9,7 @@ built-in grep tests =end pod -plan 42; +plan 44; my @list = (1 .. 10); @@ -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