2 # $Id: /mirror/googlecode/test-more/t/plan_bad.t 57943 2008-08-18T02:09:22.275428Z brooklyn.kid51 $
5 if( $ENV{PERL_CORE} ) {
12 use Test::More tests => 12;
14 my $tb = Test::Builder->create;
17 ok !eval { $tb->plan( tests => 'no_plan' ); };
18 is $@, sprintf "Number of tests must be a positive integer. You gave it 'no_plan' at %s line %d.\n", $0, __LINE__ - 1;
21 my @foo = ($foo, 2, 3);
22 ok !eval { $tb->plan( tests => @foo ) };
23 is $@, sprintf "Number of tests must be a positive integer. You gave it '$foo' at %s line %d.\n", $0, __LINE__ - 1;
25 ok !eval { $tb->plan( tests => 9.99 ) };
26 is $@, sprintf "Number of tests must be a positive integer. You gave it '9.99' at %s line %d.\n", $0, __LINE__ - 1;
29 ok !eval { $tb->plan( tests => -1 ) };
30 is $@, "Number of tests must be a positive integer. You gave it '-1' at $0 line 25.\n";
33 ok !eval { $tb->plan( tests => '' ) };
34 is $@, "You said to run 0 tests at $0 line 29.\n";
37 ok !eval { $tb->plan( 'wibble' ) };
38 is $@, "plan() doesn't understand wibble at $0 line 33.\n";