Upgrade to Test-Simple-0.82.
[p5sagit/p5-mst-13.2.git] / lib / Test / Simple / t / plan_is_noplan.t
CommitLineData
ccbd73a4 1# $Id: /mirror/googlecode/test-more/t/plan_is_noplan.t 57943 2008-08-18T02:09:22.275428Z brooklyn.kid51 $
33459055 2BEGIN {
a9153838 3 if( $ENV{PERL_CORE} ) {
4 chdir 't';
5 @INC = ('../lib', 'lib');
6 }
7 else {
8 unshift @INC, 't/lib';
9 }
33459055 10}
11
4dd974da 12# Can't use Test.pm, that's a 5.005 thing.
13package My::Test;
14
4dd974da 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
33459055 35require Test::Simple::Catch;
36my($out, $err) = Test::Simple::Catch::caught();
4dd974da 37
38
39Test::Simple->import('no_plan');
40
41ok(1, 'foo');
42
43
44END {
45 My::Test::ok($$out eq <<OUT);
46ok 1 - foo
471..1
48OUT
49
50 My::Test::ok($$err eq <<ERR);
51ERR
52
53 # Prevent Test::Simple from exiting with non zero
54 exit 0;
55}