Commit | Line | Data |
---|---|---|
30e302f8 | 1 | #!/usr/bin/perl -w |
2 | ||
3 | BEGIN { | |
4 | if( $ENV{PERL_CORE} ) { | |
5 | chdir 't'; | |
6 | @INC = ('../lib', 'lib'); | |
7 | } | |
8 | else { | |
9 | unshift @INC, 't/lib'; | |
10 | } | |
11 | } | |
12 | ||
13 | use strict; | |
14 | ||
3e887aae | 15 | # Normalize the output whether we're running under Test::Harness or not. |
30e302f8 | 16 | local $ENV{HARNESS_ACTIVE} = 0; |
17 | ||
3e887aae | 18 | use Test::Builder; |
19 | use Test::Builder::NoOutput; | |
30e302f8 | 20 | |
3e887aae | 21 | my $Test = Test::Builder->new; |
30e302f8 | 22 | |
3e887aae | 23 | { |
24 | my $tb = Test::Builder::NoOutput->create; | |
30e302f8 | 25 | |
3e887aae | 26 | $tb->plan( tests => 1 ); |
30e302f8 | 27 | |
3e887aae | 28 | #line 28 |
29 | $tb->ok(0); | |
30 | $tb->_ending; | |
30e302f8 | 31 | |
3e887aae | 32 | $Test->is_eq($tb->read('out'), <<OUT); |
30e302f8 | 33 | 1..1 |
34 | not ok 1 | |
35 | OUT | |
36 | ||
3e887aae | 37 | $Test->is_eq($tb->read('err'), <<ERR); |
38 | # Failed test at $0 line 28. | |
30e302f8 | 39 | # Looks like you failed 1 test of 1. |
40 | ERR | |
41 | ||
3e887aae | 42 | $Test->done_testing(2); |
30e302f8 | 43 | } |