Ready for 0.01
[p5sagit/B-Hooks-EndOfScope-WithFallback.git] / t / 06-exception_fallback.t
CommitLineData
4befcbc3 1use strict;
2use warnings;
3use Test::More;
4
5use B::Hooks::EndOfScope::WithFallback;
6
7plan skip_all => 'Skipping fallback test in XS mode'
8 if B::Hooks::EndOfScope::WithFallback::__HAS_VM;
9
10pass ('Expecting a regular exit, no segfaults');
11
12# because of the immediate _exit() we need to output the
13# plan-end ourselves
14print "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
22eval q[
23 sub foo {
24 BEGIN {
25 on_scope_end { die 'bar' };
26 }
27 }
28];
29