Commit | Line | Data |
30e302f8 |
1 | #!/usr/bin/perl -w |
ccbd73a4 |
2 | # $Id: /mirror/googlecode/test-more/t/extra_one.t 57943 2008-08-18T02:09:22.275428Z brooklyn.kid51 $ |
30e302f8 |
3 | |
4 | BEGIN { |
5 | if( $ENV{PERL_CORE} ) { |
6 | chdir 't'; |
7 | @INC = ('../lib', 'lib'); |
8 | } |
9 | else { |
10 | unshift @INC, 't/lib'; |
11 | } |
12 | } |
13 | |
14 | use strict; |
15 | |
16 | require Test::Simple::Catch; |
17 | my($out, $err) = Test::Simple::Catch::caught(); |
18 | |
19 | # Can't use Test.pm, that's a 5.005 thing. |
20 | package My::Test; |
21 | |
b1ddf169 |
22 | # This has to be a require or else the END block below runs before |
23 | # Test::Builder's own and the ending diagnostics don't come out right. |
24 | require Test::Builder; |
25 | my $TB = Test::Builder->create; |
26 | $TB->plan(tests => 2); |
27 | |
28 | sub is { $TB->is_eq(@_) } |
30e302f8 |
29 | |
30 | |
31 | package main; |
32 | |
33 | require Test::Simple; |
34 | Test::Simple->import(tests => 1); |
35 | ok(1); |
36 | ok(1); |
37 | ok(1); |
38 | |
39 | END { |
b1ddf169 |
40 | My::Test::is($$out, <<OUT); |
30e302f8 |
41 | 1..1 |
42 | ok 1 |
43 | ok 2 |
44 | ok 3 |
45 | OUT |
46 | |
b1ddf169 |
47 | My::Test::is($$err, <<ERR); |
ccbd73a4 |
48 | # Looks like you planned 1 test but ran 3. |
30e302f8 |
49 | ERR |
50 | |
51 | # Prevent Test::Simple from existing with non-zero |
52 | exit 0; |
53 | } |