This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
The optree builder was looping when constructing the ops
[perl5.git] / t / op / grep.t
index 4696224..3e5d716 100755 (executable)
@@ -4,7 +4,7 @@
 # grep() and map() tests
 #
 
-print "1..37\n";
+print "1..38\n";
 
 $test = 1;
 
@@ -162,3 +162,8 @@ sub ok {
     undef $gimme; map { gimme } @list;  ok($gimme, 'list');   $test++;
 }
 
+{
+    # This shouldn't loop indefinitively.
+    my @empty = map { while (1) {} } ();
+    ok("@empty", '');
+}