Re: Compress::Zlib, pack "C" and utf-8 [PATCH]
[p5sagit/p5-mst-13.2.git] / ext / Storable / t / sig_die.t
CommitLineData
e0408fa0 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
9sub BEGIN {
10 if ($ENV{PERL_CORE}){
11 chdir('t') if -d 't';
12 @INC = ('.', '../lib');
13 } else {
14 unshift @INC, 't';
15 }
16 require Config; import Config;
17 if ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bStorable\b/) {
18 print "1..0 # Skip: Storable was not built\n";
19 exit 0;
20 }
21}
22
23use strict;
24BEGIN {
25 if (!eval q{
26 use Test::More;
27 1;
28 }) {
29 print "1..0 # skip: tests only work with Test::More\n";
30 exit;
31 }
32}
33
34BEGIN { plan tests => 1 }
35
36my @warns;
37$SIG{__WARN__} = sub { push @warns, shift };
38$SIG{__DIE__} = sub { require Carp; warn Carp::longmess(); warn "Evil die!" };
39
40require Storable;
41
42Storable::dclone({foo => "bar"});
43
44is(join("", @warns), "", "__DIE__ is not evil here");