summaryrefslogtreecommitdiff
path: root/t/op/gv.t
diff options
context:
space:
mode:
authorFlorian Ragwitz <rafl@debian.org>2010-09-08 05:03:23 +0200
committerFlorian Ragwitz <rafl@debian.org>2010-09-08 05:03:23 +0200
commitcf203c62f1150b565f11422be478d513ad57902b (patch)
treec981032e4a85e93872e94a18a250de9c2314f4a1 /t/op/gv.t
parent2646967208cda4929d37b7f8f7af46f79edba94a (diff)
downloadperl-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.t20
1 files changed, 19 insertions, 1 deletions
diff --git a/t/op/gv.t b/t/op/gv.t
index 13da980365..cc8f205a85 100644
--- a/t/op/gv.t
+++ b/t/op/gv.t
@@ -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