diff options
Diffstat (limited to 't/op/misc.t')
-rwxr-xr-x | t/op/misc.t | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/t/op/misc.t b/t/op/misc.t index 881f99dc18..679dd91d0d 100755 --- a/t/op/misc.t +++ b/t/op/misc.t @@ -599,6 +599,16 @@ EOT EXPECT ok ######## +# test that closures generated by eval"" hold on to the CV of the eval"" +# for their entire lifetime +$code = eval q[ + sub { eval '$x = "ok 1\n"'; } +]; +&{$code}(); +print $x; +EXPECT +ok 1 +######## # This test is here instead of pragma/locale.t because # the bug depends on in the internal state of the locale # settings and pragma/locale messes up that state pretty badly. |