File: dont_overwrite_die_handler.t

package info (click to toggle)
libtest-simple-perl 0.94-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 836 kB
  • ctags: 224
  • sloc: perl: 5,744; makefile: 4
file content (19 lines) | stat: -rw-r--r-- 353 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/perl -w

BEGIN {
    if( $ENV{PERL_CORE} ) {
        chdir 't';
        @INC = '../lib';
    }
}

# Make sure this is in place before Test::More is loaded.
my $handler_called;
BEGIN {
    $SIG{__DIE__} = sub { $handler_called++ };
}

use Test::More tests => 2;

ok !eval { die };
is $handler_called, 1, 'existing DIE handler not overridden';