3 # Simple test of what failure output looks like
6 if( $ENV{PERL_CORE} ) {
8 @INC = ('../lib', 'lib');
11 unshift @INC, 't/lib';
17 # Normalize the output whether we're running under Test::Harness or not.
18 local $ENV{HARNESS_ACTIVE} = 0;
21 use Test::Builder::NoOutput;
23 my $Test = Test::Builder->new;
25 # Set up a builder to record some failing tests.
27 my $tb = Test::Builder::NoOutput->create;
28 $tb->plan( tests => 5 );
31 $tb->ok( 1, 'passing' );
32 $tb->ok( 2, 'passing still' );
33 $tb->ok( 3, 'still passing' );
34 $tb->ok( 0, 'oh no!' );
35 $tb->ok( 0, 'damnit' );
38 $Test->is_eq($tb->read('out'), <<OUT);
47 $Test->is_eq($tb->read('err'), <<ERR);
48 # Failed test 'oh no!'
50 # Failed test 'damnit'
52 # Looks like you failed 2 tests of 5.
55 $Test->done_testing(2);