malloc() things must be free()d, not Safefree()d (bug in change#11280
[p5sagit/p5-mst-13.2.git] / lib / Test / Simple / t / plan_no_plan.t
CommitLineData
33459055 1BEGIN {
2 chdir 't' if -d 't';
3 @INC = '../lib';
4}
5
6# Can't use Test.pm, that's a 5.005 thing.
7package My::Test;
8
9print "1..2\n";
10
11my $test_num = 1;
12# Utility testing functions.
13sub ok ($;$) {
14 my($test, $name) = @_;
15 my $ok = '';
16 $ok .= "not " unless $test;
17 $ok .= "ok $test_num";
18 $ok .= " - $name" if defined $name;
19 $ok .= "\n";
20 print $ok;
21 $test_num++;
22}
23
24
25package main;
26
27require Test::More;
28Test::More->import;
29my($out, $err);
30
31BEGIN {
32 require Test::Harness;
33}
34
35if( $Test::Harness::VERSION < 1.20 ) {
36 plan(skip_all => 'Need Test::Harness 1.20 or up');
37}
38else {
39 push @INC, '../t/lib';
40 require Test::Simple::Catch;
41 ($out, $err) = Test::Simple::Catch::caught();
42 plan('no_plan');
43}
44
45pass('Just testing');
46ok(1, 'Testing again');
47
48END {
49 My::Test::ok($$out eq <<OUT);
50ok 1 - Just testing
51ok 2 - Testing again
521..2
53OUT
54
55 My::Test::ok($$err eq '');
56}