X-Git-Url: http://git.maemo.org/git/?p=dh-make-perl;a=blobdiff_plain;f=dev%2Farm%2Flibtest-simple-perl%2Flibtest-simple-perl-0.80%2Ft%2Fplan_bad.t;fp=dev%2Farm%2Flibtest-simple-perl%2Flibtest-simple-perl-0.80%2Ft%2Fplan_bad.t;h=d20797ecb770a8180e8e3fe76465bd49210739d4;hp=0000000000000000000000000000000000000000;hb=f477fa73365d491991707e7ed9217b48d6994551;hpb=da95c414033799c3a62606f299c3c00b5c77ca11 diff --git a/dev/arm/libtest-simple-perl/libtest-simple-perl-0.80/t/plan_bad.t b/dev/arm/libtest-simple-perl/libtest-simple-perl-0.80/t/plan_bad.t new file mode 100644 index 0000000..d20797e --- /dev/null +++ b/dev/arm/libtest-simple-perl/libtest-simple-perl-0.80/t/plan_bad.t @@ -0,0 +1,34 @@ +#!/usr/bin/perl -w + +BEGIN { + if( $ENV{PERL_CORE} ) { + chdir 't'; + @INC = '../lib'; + } +} + + +use Test::More tests => 10; +use Test::Builder; +my $tb = Test::Builder->create; +$tb->level(0); + +ok !eval { $tb->plan( tests => 'no_plan' ); }; +is $@, sprintf "Number of tests must be a positive integer. You gave it 'no_plan' at %s line %d.\n", $0, __LINE__ - 1; + +my $foo = []; +my @foo = ($foo, 2, 3); +ok !eval { $tb->plan( tests => @foo ) }; +is $@, sprintf "Number of tests must be a positive integer. You gave it '$foo' at %s line %d.\n", $0, __LINE__ - 1; + +#line 25 +ok !eval { $tb->plan( tests => -1 ) }; +is $@, "Number of tests must be a positive integer. You gave it '-1' at $0 line 25.\n"; + +#line 29 +ok !eval { $tb->plan( tests => '' ) }; +is $@, "You said to run 0 tests at $0 line 29.\n"; + +#line 33 +ok !eval { $tb->plan( 'wibble' ) }; +is $@, "plan() doesn't understand wibble at $0 line 33.\n";