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