Clear up test based on line number differences between the core and the
[p5sagit/p5-mst-13.2.git] / lib / Test / Simple / t / plan_is_noplan.t
CommitLineData
33459055 1BEGIN {
a9153838 2 if( $ENV{PERL_CORE} ) {
3 chdir 't';
4 @INC = ('../lib', 'lib');
5 }
6 else {
7 unshift @INC, 't/lib';
8 }
33459055 9}
10
4dd974da 11# Can't use Test.pm, that's a 5.005 thing.
12package My::Test;
13
4dd974da 14print "1..2\n";
15
16my $test_num = 1;
17# Utility testing functions.
18sub ok ($;$) {
19 my($test, $name) = @_;
11ea77c5 20 my $ok = '';
21 $ok .= "not " unless $test;
22 $ok .= "ok $test_num";
23 $ok .= " - $name" if defined $name;
24 $ok .= "\n";
25 print $ok;
4dd974da 26 $test_num++;
27}
28
29
30package main;
31
32require Test::Simple;
33
33459055 34require Test::Simple::Catch;
35my($out, $err) = Test::Simple::Catch::caught();
4dd974da 36
37
38Test::Simple->import('no_plan');
39
40ok(1, 'foo');
41
42
43END {
44 My::Test::ok($$out eq <<OUT);
45ok 1 - foo
461..1
47OUT
48
49 My::Test::ok($$err eq <<ERR);
50ERR
51
52 # Prevent Test::Simple from exiting with non zero
53 exit 0;
54}