Upgrade to Test-Simple-0.82.
[p5sagit/p5-mst-13.2.git] / lib / Test / Simple / t / bad_plan.t
CommitLineData
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
4BEGIN {
5 if( $ENV{PERL_CORE} ) {
6 chdir 't';
7 @INC = '../lib';
8 }
9}
10
11my $test_num = 1;
12# Utility testing functions.
13sub 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
27use Test::Builder;
28my $Test = Test::Builder->new;
29
30print "1..2\n";
31
32eval { $Test->plan(7); };
33ok( $@ =~ /^plan\(\) doesn't understand 7/, 'bad plan()' ) ||
34 print STDERR "# $@";
35
36eval { $Test->plan(wibble => 7); };
37ok( $@ =~ /^plan\(\) doesn't understand wibble 7/, 'bad plan()' ) ||
38 print STDERR "# $@";
39