This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
don't crash on deep recursion warnings in lexical subs (#118521)
[perl5.git] / t / op / lexsub.t
index d70f2cc..27b6de7 100644 (file)
@@ -8,7 +8,7 @@ BEGIN {
     *bar::like = *like;
 }
 no warnings 'deprecated';
-plan 134;
+plan 135;
 
 # -------------------- Errors with feature disabled -------------------- #
 
@@ -695,3 +695,11 @@ eval 'sub not_lexical7 { my @x }';
     }
   }
 }
+
+like runperl(
+      switches => [ '-Mfeature=:all', '-Mwarnings=FATAL,all', '-M-warnings=experimental::lexical_subs' ],
+      prog     => 'my sub foo; sub foo { foo } foo',
+      stderr   => 1
+     ),
+     qr/Deep recursion on subroutine "foo"/,
+    'deep recursion warnings for lexical subs do not crash';