in reply to Re^2: BAIL_OUT with older Test::More
in thread BAIL_OUT with older Test::More
#!/usr/bin/perl use strict; use warnings; use Test::Builder; use Test::More; BEGIN { use_ok( 'Test::Simple ' ); } my $Exit_Code; BEGIN { *CORE::GLOBAL::exit = sub { $Exit_Code = shift; }; } my $output; my $TB = Test::More->builder; $TB->output(\$output); my $Test = Test::Builder->create; $Test->level(0); $Test->plan(tests => 3); plan tests => 1; $Test->is_eq( $output, <<'OUT' ); 1..3 Bail out! Sayonara! OUT if ($Test) { $Test->is_eq( $Exit_Code, 255 ); $Test->ok( $Test->can("BAILOUT"), "Backwards compat" ); } else { BAILOUT(print "Sayonara!\n"); }
|
|---|