4 if( $ENV{PERL_CORE} ) {
6 @INC = ('../lib', 'lib');
15 *CORE::GLOBAL::exit = sub { $Exit_Code = shift; };
23 my $output = tie *FAKEOUT, 'TieOut';
24 my $TB = Test::More->builder;
25 $TB->output(\*FAKEOUT);
27 my $Test = Test::Builder->create;
31 $Test->plan(tests => 3);
34 $Test->plan(skip_all =>
35 'CORE::GLOBAL::exit, introduced in 5.005, is needed for testing');
41 BAIL_OUT("ROCKS FALL! EVERYONE DIES!");
44 $Test->is_eq( $output->read, <<'OUT' );
46 Bail out! ROCKS FALL! EVERYONE DIES!
49 $Test->is_eq( $Exit_Code, 255 );
51 $Test->ok( $Test->can("BAILOUT"), "Backwards compat" );