2 if( $ENV{PERL_CORE} ) {
4 @INC = ('../lib', 'lib');
11 # Can't use Test.pm, that's a 5.005 thing.
17 # Utility testing functions.
19 my($test, $name) = @_;
21 $ok .= "not " unless $test;
22 $ok .= "ok $test_num";
23 $ok .= " - $name" if defined $name;
34 require Test::Simple::Catch;
35 my($out, $err) = Test::Simple::Catch::caught();
41 My::Test::ok($$out eq '');
42 My::Test::ok($$err eq '');
43 My::Test::ok($@ eq '');
46 Test::Simple->import(tests => undef);
49 My::Test::ok($$out eq '');
50 My::Test::ok($$err eq '');
51 My::Test::ok($@ =~ /Got an undefined number of tests/);
54 Test::Simple->import(tests => 0);
57 My::Test::ok($$out eq '');
58 My::Test::ok($$err eq '');
59 My::Test::ok($@ =~ /You said to run 0 tests!/);
64 My::Test::ok( $@ =~ /You tried to run a test without a plan!/);
68 My::Test::ok($$out eq '');
69 My::Test::ok($$err eq "");
71 # Prevent Test::Simple from exiting with non zero.