4 if( $ENV{PERL_CORE} ) {
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;
33 my($this, $that, $name) = @_;
34 my $test = $this eq $that;
36 $ok .= "not " unless $test;
37 $ok .= "ok $test_num";
38 $ok .= " - $name" if defined $name;
43 print "# got \n$this";
44 print "# expected \n$that";
52 use Test::More import => ['plan'];
54 ok !eval { plan tests => 'no_plan'; };
55 is $@, "Number of tests must be a postive integer. You gave it 'no_plan'.\n";
58 my @foo = ($foo, 2, 3);
59 ok !eval { plan tests => @foo };
60 is $@, "Number of tests must be a postive integer. You gave it '$foo'.\n";
62 ok !eval { plan tests => 0 };
63 ok !eval { plan tests => -1 };
64 ok !eval { plan tests => '' };