summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/perl/dist/Storable/t/sig_die.t
blob: 3ea2df4f0dd95d49c714e42c06578ea186123099 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!./perl
#
#  Copyright (c) 2002 Slaven Rezic
#
#  You may redistribute only under the same terms as Perl 5, as specified
#  in the README file that comes with the distribution.
#

sub BEGIN {
    unshift @INC, 't';
    unshift @INC, 't/compat' if $] < 5.006002;
    require Config; import Config;
    if ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bStorable\b/) {
        print "1..0 # Skip: Storable was not built\n";
        exit 0;
    }
}

use strict;
use Test::More tests => 1;

my @warns;
$SIG{__WARN__} = sub { push @warns, shift };
$SIG{__DIE__}  = sub { require Carp; warn Carp::longmess(); warn "Evil die!" };

require Storable;

Storable::dclone({foo => "bar"});

is(join("", @warns), "", "__DIE__ is not evil here");