diff options
author | Florian Ragwitz <rafl@debian.org> | 2010-09-08 05:03:23 +0200 |
---|---|---|
committer | Florian Ragwitz <rafl@debian.org> | 2010-09-08 05:03:23 +0200 |
commit | cf203c62f1150b565f11422be478d513ad57902b (patch) | |
tree | c981032e4a85e93872e94a18a250de9c2314f4a1 /t/op/gv.t | |
parent | 2646967208cda4929d37b7f8f7af46f79edba94a (diff) | |
download | perl-cf203c62f1150b565f11422be478d513ad57902b.tar.gz |
Move test for #76540 to op/gv.t
Commit e5c69c9b added the test to dist/constant/t/constant.t, probably because
the bug was initially reported in combination with constant.pm. However, it was
a core bug in gv_init and can be reproduced easily without constant.pm.
With this change dist/constant can be safely synced back to CPAN without having
to SKIP or TODO this particular test.
Diffstat (limited to 't/op/gv.t')
-rw-r--r-- | t/op/gv.t | 20 |
1 files changed, 19 insertions, 1 deletions
@@ -12,7 +12,7 @@ BEGIN { use warnings; require './test.pl'; -plan( tests => 192 ); +plan( tests => 194 ); # type coersion on assignment $foo = 'foo'; @@ -634,6 +634,24 @@ is (scalar $::{fake}, "*main::sym", ); } +# [perl #76540] +# this caused panics or 'Attempt to free unreferenced scalar' +# (its a compile-time issue, so the die lets us skip the prints) +{ + my @warnings; + local $SIG{__WARN__} = sub { push @warnings, @_ }; + + eval <<'EOF'; +BEGIN { $::{FOO} = \'bar' } +die "made it"; +print FOO, "\n"; +print FOO, "\n"; +EOF + + like($@, qr/made it/, "#76540 - no panic"); + ok(!@warnings, "#76540 - no 'Attempt to free unreferenced scalar'"); +} + __END__ Perl Rules |