This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
lexsub.t: Test state sub defined inside eval
authorFather Chrysostomos <sprout@cpan.org>
Sun, 9 Sep 2012 18:09:53 +0000 (11:09 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Sun, 16 Sep 2012 05:45:09 +0000 (22:45 -0700)
t/cmd/lexsub.t

index ebf1188..24dc5b0 100644 (file)
@@ -8,7 +8,7 @@ BEGIN {
     *bar::like = *like;
 }
 no warnings 'deprecated';
-plan 121;
+plan 122;
 
 # -------------------- our -------------------- #
 
@@ -286,6 +286,11 @@ sub make_anon_with_state_sub{
   }
   p(my @a);
 }
+{
+  state sub x;
+  eval 'sub x {3}';
+  is x, 3, 'state sub defined inside eval';
+}
 
 # -------------------- my -------------------- #