Add ARM files
[dh-make-perl] / dev / arm / libtest-simple-perl / libtest-simple-perl-0.80 / t / plan_bad.t
1 #!/usr/bin/perl -w
2
3 BEGIN {
4     if( $ENV{PERL_CORE} ) {
5         chdir 't';
6         @INC = '../lib';
7     }
8 }
9
10
11 use Test::More tests => 10;
12 use Test::Builder;
13 my $tb = Test::Builder->create;
14 $tb->level(0);
15
16 ok !eval { $tb->plan( tests => 'no_plan' ); };
17 is $@, sprintf "Number of tests must be a positive integer.  You gave it 'no_plan' at %s line %d.\n", $0, __LINE__ - 1;
18
19 my $foo = [];
20 my @foo = ($foo, 2, 3);
21 ok !eval { $tb->plan( tests => @foo ) };
22 is $@, sprintf "Number of tests must be a positive integer.  You gave it '$foo' at %s line %d.\n", $0, __LINE__ - 1;
23
24 #line 25
25 ok !eval { $tb->plan( tests => -1 ) };
26 is $@, "Number of tests must be a positive integer.  You gave it '-1' at $0 line 25.\n";
27
28 #line 29
29 ok !eval { $tb->plan( tests => '' ) };
30 is $@, "You said to run 0 tests at $0 line 29.\n";
31
32 #line 33
33 ok !eval { $tb->plan( 'wibble' ) };
34 is $@, "plan() doesn't understand wibble at $0 line 33.\n";