summaryrefslogtreecommitdiff
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
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.
-rw-r--r--dist/constant/t/constant.t15
-rw-r--r--t/op/gv.t20
2 files changed, 20 insertions, 15 deletions
diff --git a/dist/constant/t/constant.t b/dist/constant/t/constant.t
index 793ac0a72d..85a9355a19 100644
--- a/dist/constant/t/constant.t
+++ b/dist/constant/t/constant.t
@@ -9,7 +9,7 @@ END { @warnings && print STDERR join "\n- ", "accumulated warnings:", @warnings
use strict;
-use Test::More tests => 97;
+use Test::More tests => 96;
my $TB = Test::More->builder;
BEGIN { use_ok('constant'); }
@@ -347,16 +347,3 @@ $kloong = 'schlozhauer';
eval 'use constant undef, 5; 1';
like $@, qr/\ACan't use undef as constant name at /;
}
-
-# [perl #76540]
-# this caused panics or 'Attempt to free unreferenced scalar'
-# (its a compile-time issue, so the die lets us skip the prints)
-
-eval <<EOF;
-use constant FOO => 'bar';
-die "made it";
-print FOO, "\n";
-print FOO, "\n";
-EOF
-like($@, qr/made it/, "#76540");
-
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