Commit | Line | Data |
a344be10 |
1 | #!/usr/bin/perl -w |
ccbd73a4 |
2 | # $Id: /mirror/googlecode/test-more/t/bad_plan.t 57943 2008-08-18T02:09:22.275428Z brooklyn.kid51 $ |
a344be10 |
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 | |