Commit | Line | Data |
33459055 |
1 | #!perl -w |
2 | |
15db8fc4 |
3 | BEGIN { |
a9153838 |
4 | if( $ENV{PERL_CORE} ) { |
5 | chdir 't'; |
6 | @INC = '../lib'; |
7 | } |
15db8fc4 |
8 | } |
9 | |
4dd974da |
10 | # Can't use Test.pm, that's a 5.005 thing. |
11 | package My::Test; |
12 | |
b1ddf169 |
13 | # This has to be a require or else the END block below runs before |
14 | # Test::Builder's own and the ending diagnostics don't come out right. |
15 | require Test::Builder; |
16 | my $TB = Test::Builder->create; |
17 | $TB->plan(tests => 2); |
4dd974da |
18 | |
19 | |
20 | package main; |
21 | |
22 | require Test::Simple; |
23 | |
a9153838 |
24 | chdir 't'; |
33459055 |
25 | push @INC, '../t/lib/'; |
d020a79a |
26 | require Test::Simple::Catch; |
27 | my($out, $err) = Test::Simple::Catch::caught(); |
30e302f8 |
28 | local $ENV{HARNESS_ACTIVE} = 0; |
4dd974da |
29 | |
30 | Test::Simple->import(tests => 3); |
31 | |
0cd946aa |
32 | #line 30 |
4dd974da |
33 | ok(1, 'Foo'); |
34 | ok(0, 'Bar'); |
35 | ok(1, 'Yar'); |
36 | ok(1, 'Car'); |
37 | ok(0, 'Sar'); |
38 | |
39 | END { |
b1ddf169 |
40 | $TB->is_eq($$out, <<OUT); |
4dd974da |
41 | 1..3 |
42 | ok 1 - Foo |
43 | not ok 2 - Bar |
44 | ok 3 - Yar |
45 | ok 4 - Car |
46 | not ok 5 - Sar |
47 | OUT |
48 | |
b1ddf169 |
49 | $TB->is_eq($$err, <<ERR); |
50 | # Failed test 'Bar' |
51 | # in $0 at line 31. |
52 | # Failed test 'Sar' |
53 | # in $0 at line 34. |
33459055 |
54 | # Looks like you planned 3 tests but ran 2 extra. |
b1ddf169 |
55 | # Looks like you failed 2 tests of 5 run. |
33459055 |
56 | ERR |
4dd974da |
57 | |
58 | exit 0; |
59 | } |