xref: /openbsd-src/gnu/usr.bin/perl/cpan/Test-Simple/t/lib/Test/Simple/sample_tests/death_with_handler.plx (revision b39c515898423c8d899e35282f4b395f7cad3298)
1require Test::Simple;
2
3push @INC, 't/lib';
4require Test::Simple::Catch;
5my($out, $err) = Test::Simple::Catch::caught();
6
7Test::Simple->import(tests => 2);
8
9# Test we still get the right exit code despite having a die
10# handler.
11$SIG{__DIE__} = sub {};
12
13require Dev::Null;
14tie *STDERR, 'Dev::Null';
15
16ok(1);
17ok(1);
18
19$! = 0;
20die "This is a test";
21