Remove broken links for hip communications inc.
[p5sagit/p5-mst-13.2.git] / ext / Test-Simple / t / fail.t
1 #!perl -w
2
3 # Simple test of what failure output looks like
4
5 BEGIN {
6     if( $ENV{PERL_CORE} ) {
7         chdir 't';
8         @INC = ('../lib', 'lib');
9     }
10     else {
11         unshift @INC, 't/lib';
12     }
13 }
14
15 use strict;
16
17 # Normalize the output whether we're running under Test::Harness or not.
18 local $ENV{HARNESS_ACTIVE} = 0;
19
20 use Test::Builder;
21 use Test::Builder::NoOutput;
22
23 my $Test = Test::Builder->new;
24
25 # Set up a builder to record some failing tests.
26 {
27     my $tb = Test::Builder::NoOutput->create;
28     $tb->plan( tests => 5 );
29
30 #line 28
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' );
36     $tb->_ending;
37
38     $Test->is_eq($tb->read('out'), <<OUT);
39 1..5
40 ok 1 - passing
41 ok 2 - passing still
42 ok 3 - still passing
43 not ok 4 - oh no!
44 not ok 5 - damnit
45 OUT
46
47     $Test->is_eq($tb->read('err'), <<ERR);
48 #   Failed test 'oh no!'
49 #   at $0 line 31.
50 #   Failed test 'damnit'
51 #   at $0 line 32.
52 # Looks like you failed 2 tests of 5.
53 ERR
54
55     $Test->done_testing(2);
56 }