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