Clear up test based on line number differences between the core and the
[p5sagit/p5-mst-13.2.git] / lib / Test / Simple / t / missing.t
CommitLineData
15db8fc4 1BEGIN {
a9153838 2 if( $ENV{PERL_CORE} ) {
3 chdir 't';
4 @INC = ('../lib', 'lib');
5 }
6 else {
7 unshift @INC, 't/lib';
8 }
15db8fc4 9}
10
33459055 11# Can't use Test.pm, that's a 5.005 thing.
4dd974da 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);
19
20sub is { $TB->is_eq(@_) }
4dd974da 21
22
23package main;
24
25require Test::Simple;
26
d020a79a 27require Test::Simple::Catch;
28my($out, $err) = Test::Simple::Catch::caught();
30e302f8 29local $ENV{HARNESS_ACTIVE} = 0;
4dd974da 30
31Test::Simple->import(tests => 5);
32
0cd946aa 33#line 30
4dd974da 34ok(1, 'Foo');
35ok(0, 'Bar');
36
37END {
b1ddf169 38 My::Test::is($$out, <<OUT);
4dd974da 391..5
40ok 1 - Foo
41not ok 2 - Bar
42OUT
43
b1ddf169 44 My::Test::is($$err, <<ERR);
45# Failed test 'Bar'
46# in $0 at line 31.
33459055 47# Looks like you planned 5 tests but only ran 2.
b1ddf169 48# Looks like you failed 1 test of 2 run.
33459055 49ERR
4dd974da 50
51 exit 0;
52}