Upgrade to Test-Simple-0.82.
[p5sagit/p5-mst-13.2.git] / lib / Test / Simple / t / bad_plan.t
1 #!/usr/bin/perl -w
2 # $Id: /mirror/googlecode/test-more/t/bad_plan.t 57943 2008-08-18T02:09:22.275428Z brooklyn.kid51  $
3
4 BEGIN {
5     if( $ENV{PERL_CORE} ) {
6         chdir 't';
7         @INC = '../lib';
8     }
9 }
10
11 my $test_num = 1;
12 # Utility testing functions.
13 sub 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     return $test;
24 }
25
26
27 use Test::Builder;
28 my $Test = Test::Builder->new;
29
30 print "1..2\n";
31
32 eval { $Test->plan(7); };
33 ok( $@ =~ /^plan\(\) doesn't understand 7/, 'bad plan()' ) ||
34     print STDERR "# $@";
35
36 eval { $Test->plan(wibble => 7); };
37 ok( $@ =~ /^plan\(\) doesn't understand wibble 7/, 'bad plan()' ) ||
38     print STDERR "# $@";
39