2 # $Id: /mirror/googlecode/test-more/t/no_plan.t 60319 2008-09-08T21:16:57.125001Z schwern $
5 if( $ENV{PERL_CORE} ) {
7 @INC = ('../lib', 'lib');
10 unshift @INC, 't/lib';
14 use Test::More tests => 9;
16 my $tb = Test::Builder->create;
20 ok !eval { $tb->plan(tests => undef) };
21 is($@, "Got an undefined number of tests at $0 line 20.\n");
24 ok !eval { $tb->plan(tests => 0) };
25 is($@, "You said to run 0 tests at $0 line 24.\n");
28 ok !eval { $tb->ok(1) };
29 is( $@, "You tried to run a test without a plan at $0 line 28.\n");
33 local $SIG{__WARN__} = sub { $warning .= join '', @_ };
36 ok $tb->plan(no_plan => 1);
37 is( $warning, "no_plan takes no arguments at $0 line 36.\n" );
38 is $tb->has_plan, 'no_plan';