X-Git-Url: http://git.maemo.org/git/?p=dh-make-perl;a=blobdiff_plain;f=dev%2Fi386%2Flibtest-simple-perl%2Flibtest-simple-perl-0.80%2Ft%2Fbad_plan.t;fp=dev%2Fi386%2Flibtest-simple-perl%2Flibtest-simple-perl-0.80%2Ft%2Fbad_plan.t;h=442fee86f098efffb68122e8fcb6ca589b7033cf;hp=0000000000000000000000000000000000000000;hb=8977e561d8a9eae6959218b0306c9df2056a38a9;hpb=df794b845212301ea0d267c919232538bfef356a diff --git a/dev/i386/libtest-simple-perl/libtest-simple-perl-0.80/t/bad_plan.t b/dev/i386/libtest-simple-perl/libtest-simple-perl-0.80/t/bad_plan.t new file mode 100644 index 0000000..442fee8 --- /dev/null +++ b/dev/i386/libtest-simple-perl/libtest-simple-perl-0.80/t/bad_plan.t @@ -0,0 +1,38 @@ +#!/usr/bin/perl -w + +BEGIN { + if( $ENV{PERL_CORE} ) { + chdir 't'; + @INC = '../lib'; + } +} + +my $test_num = 1; +# Utility testing functions. +sub ok ($;$) { + my($test, $name) = @_; + my $ok = ''; + $ok .= "not " unless $test; + $ok .= "ok $test_num"; + $ok .= " - $name" if defined $name; + $ok .= "\n"; + print $ok; + $test_num++; + + return $test; +} + + +use Test::Builder; +my $Test = Test::Builder->new; + +print "1..2\n"; + +eval { $Test->plan(7); }; +ok( $@ =~ /^plan\(\) doesn't understand 7/, 'bad plan()' ) || + print STDERR "# $@"; + +eval { $Test->plan(wibble => 7); }; +ok( $@ =~ /^plan\(\) doesn't understand wibble 7/, 'bad plan()' ) || + print STDERR "# $@"; +