This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Uncomment and fix up tests at the end of Storable's blessed.t
[perl5.git] / dist / Storable / t / sig_die.t
1 #!./perl
2 #
3 #  Copyright (c) 2002 Slaven Rezic
4 #
5 #  You may redistribute only under the same terms as Perl 5, as specified
6 #  in the README file that comes with the distribution.
7 #
8
9 sub BEGIN {
10     unshift @INC, 't';
11     require Config; import Config;
12     if ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bStorable\b/) {
13         print "1..0 # Skip: Storable was not built\n";
14         exit 0;
15     }
16 }
17
18 use strict;
19 BEGIN {
20     if (!eval q{
21        use Test::More;
22        1;
23     }) {
24        print "1..0 # skip: tests only work with Test::More\n";
25        exit;
26     }
27 }
28
29 BEGIN { plan tests => 1 }
30
31 my @warns;
32 $SIG{__WARN__} = sub { push @warns, shift };
33 $SIG{__DIE__}  = sub { require Carp; warn Carp::longmess(); warn "Evil die!" };
34
35 require Storable;
36
37 Storable::dclone({foo => "bar"});
38
39 is(join("", @warns), "", "__DIE__ is not evil here");