6df646b684bfdbe932f6dd9093492f05e78f9f5f
[p5sagit/B-Hooks-EndOfScope-WithFallback.git] / t / 06-exception_fallback.t
1 use strict;
2 use warnings;
3 use Test::More;
4
5 use B::Hooks::EndOfScope::WithFallback;
6
7 plan skip_all => 'Skipping fallback test in XS mode'
8   if B::Hooks::EndOfScope::WithFallback::__HAS_VM;
9
10 pass ('Expecting a regular exit, no segfaults');
11
12 # because of the immediate _exit() we need to output the
13 # plan-end ourselves
14 print "1..1\n";
15
16 # tweak the exit code
17 $ENV{B_HOOKS_EOS_PP_ON_DIE_EXITCODE} = 0;
18
19 # move STDERR to STDOUT to not flood the diag with crap
20 *STDERR = *STDOUT;
21
22 eval q[
23     sub foo {
24         BEGIN {
25             on_scope_end { die 'bar' };
26         }
27     }
28 ];
29