Message-Id: <
200201031526.PAA06095@tempest.npl.co.uk>
p4raw-id: //depot/perl@14040
use Carp qw(carp cluck croak confess);
-print "1..8\n";
+print "1..9\n";
print "ok 1\n";
my %info = eval($eval);
print "not " if ($info{sub_name} ne "eval '$eval'");
print "ok 8\n";
+
+# test for '...::CARP_NOT used only once' warning from Carp::Heavy
+my $warning;
+eval {
+ BEGIN {
+ $^W = 1;
+ $SIG{__WARN__} =
+ sub { if( defined $^S ){ warn $_[0] } else { $warning = $_[0] } }
+ }
+ package Z;
+ BEGIN { eval { Carp::croak() } }
+};
+print $warning ? "not ok 9\n#$warning" : "ok 9\n";
sub trusts_directly {
my $class = shift;
no strict 'refs';
+ no warnings 'once';
return @{"$class\::CARP_NOT"}
? @{"$class\::CARP_NOT"}
: @{"$class\::ISA"};