D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
usr
/
share
/
doc
/
perl-Test-Simple
/
t
/
Legacy
/
subtest
/
Filename :
bail_out.t
back
Copy
#!/usr/bin/perl -w # HARNESS-NO-STREAM # HARNESS-NO-PRELOAD BEGIN { if( $ENV{PERL_CORE} ) { chdir 't'; @INC = ('../lib', 'lib'); } else { unshift @INC, 't/lib'; } } my $goto = 0; my $Exit_Code; BEGIN { *CORE::GLOBAL::exit = sub { $Exit_Code = shift; goto XXX if $goto; CORE::exit($Exit_Code)}; } use Test::Builder; use Test::More; my $skip = ref(Test::Builder->new->{Stack}->top->format) ne 'Test::Builder::Formatter'; plan skip_all => "This test cannot be run with the current formatter" if $skip; $goto = 1; my $output; my $TB = Test::More->builder; $TB->output(\$output); my $Test = Test::Builder->create; $Test->level(0); $Test->plan(tests => 2); plan tests => 4; ok 'foo'; subtest 'bar' => sub { plan tests => 3; ok 'sub_foo'; subtest 'sub_bar' => sub { plan tests => 3; ok 'sub_sub_foo'; ok 'sub_sub_bar'; BAIL_OUT("ROCKS FALL! EVERYONE DIES!"); ok 'sub_sub_baz'; }; ok 'sub_baz'; }; XXX: $Test->is_eq( $output, <<'OUT' ); 1..4 ok 1 # Subtest: bar 1..3 ok 1 # Subtest: sub_bar 1..3 ok 1 ok 2 Bail out! ROCKS FALL! EVERYONE DIES! OUT $Test->is_eq( $Exit_Code, 255 ); Test2::API::test2_stack()->top->set_no_ending(1);
Name
Size
Last Modified
Owner
Permissions
Actions
args.t
0.605
KB
March 30 2018 5:53:02
root
0644
bail_out.t
1.25
KB
March 30 2018 5:53:02
root
0644
basic.t
4.699
KB
March 30 2018 5:53:02
root
0644
callback.t
0.992
KB
March 30 2018 5:53:02
root
0644
die.t
0.522
KB
March 30 2018 5:53:02
root
0644
do.t
0.276
KB
March 30 2018 5:53:02
root
0644
events.t
0.367
KB
March 30 2018 5:53:02
root
0644
for_do_t.test
0.109
KB
March 30 2018 5:53:02
root
0644
fork.t
1.199
KB
March 30 2018 5:53:02
root
0644
implicit_done.t
0.468
KB
March 30 2018 5:53:02
root
0644
line_numbers.t
3.768
KB
March 30 2018 5:53:02
root
0644
plan.t
1.345
KB
March 30 2018 5:53:02
root
0644
predicate.t
4.73
KB
March 30 2018 5:53:02
root
0644
singleton.t
0.695
KB
March 30 2018 5:53:02
root
0644
threads.t
0.42
KB
March 30 2018 5:53:02
root
0644
todo.t
5.334
KB
March 30 2018 5:53:02
root
0644
wstat.t
0.36
KB
March 30 2018 5:53:02
root
0644
2017 © D7net | D704T team