& what's to be done for 5.8.0?
[p5sagit/p5-mst-13.2.git] / lib / Test / Simple / t / plan_is_noplan.t
CommitLineData
4dd974da 1# Can't use Test.pm, that's a 5.005 thing.
2package My::Test;
3
4# This feature requires a fairly new version of Test::Harness
5BEGIN {
88587957 6 chdir 't' if -d 't';
7 @INC = '../lib';
4dd974da 8 require Test::Harness;
9 if( $Test::Harness::VERSION < 1.20 ) {
10 print "1..0\n";
11 exit(0);
12 }
13}
14
15print "1..2\n";
16
17my $test_num = 1;
18# Utility testing functions.
19sub ok ($;$) {
20 my($test, $name) = @_;
11ea77c5 21 my $ok = '';
22 $ok .= "not " unless $test;
23 $ok .= "ok $test_num";
24 $ok .= " - $name" if defined $name;
25 $ok .= "\n";
26 print $ok;
4dd974da 27 $test_num++;
28}
29
30
31package main;
32
33require Test::Simple;
34
15db8fc4 35push @INC, '../t/lib';
d020a79a 36require Test::Simple::Catch::More;
37my($out, $err) = Test::Simple::Catch::More::caught();
4dd974da 38
39
40Test::Simple->import('no_plan');
41
42ok(1, 'foo');
43
44
45END {
46 My::Test::ok($$out eq <<OUT);
47ok 1 - foo
481..1
49OUT
50
51 My::Test::ok($$err eq <<ERR);
52ERR
53
54 # Prevent Test::Simple from exiting with non zero
55 exit 0;
56}