Blame t/sig_die.t

Packit 14c646
#!./perl
Packit 14c646
#
Packit 14c646
#  Copyright (c) 2002 Slaven Rezic
Packit 14c646
#
Packit 14c646
#  You may redistribute only under the same terms as Perl 5, as specified
Packit 14c646
#  in the README file that comes with the distribution.
Packit 14c646
#
Packit 14c646
Packit 14c646
sub BEGIN {
Packit 14c646
    unshift @INC, 't';
Packit 14c646
    unshift @INC, 't/compat' if $] < 5.006002;
Packit 14c646
    require Config; import Config;
Packit 14c646
    if ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bStorable\b/) {
Packit 14c646
        print "1..0 # Skip: Storable was not built\n";
Packit 14c646
        exit 0;
Packit 14c646
    }
Packit 14c646
}
Packit 14c646
Packit 14c646
use strict;
Packit 14c646
use Test::More tests => 1;
Packit 14c646
Packit 14c646
my @warns;
Packit 14c646
$SIG{__WARN__} = sub { push @warns, shift };
Packit 14c646
$SIG{__DIE__}  = sub { require Carp; warn Carp::longmess(); warn "Evil die!" };
Packit 14c646
Packit 14c646
require Storable;
Packit 14c646
Packit 14c646
Storable::dclone({foo => "bar"});
Packit 14c646
Packit 14c646
is(join("", @warns), "", "__DIE__ is not evil here");