Move Test::Simple from lib to ext.
[p5sagit/p5-mst-13.2.git] / ext / Test-Simple / t / no_plan.t
CommitLineData
b7f9bbeb 1#!/usr/bin/perl -w
2
15db8fc4 3BEGIN {
a9153838 4 if( $ENV{PERL_CORE} ) {
5 chdir 't';
6 @INC = ('../lib', 'lib');
7 }
8 else {
9 unshift @INC, 't/lib';
10 }
15db8fc4 11}
12
3e887aae 13use Test::More tests => 7;
4dd974da 14
b7f9bbeb 15my $tb = Test::Builder->create;
4dd974da 16
82d700dc 17#line 20
b7f9bbeb 18ok !eval { $tb->plan(tests => undef) };
82d700dc 19is($@, "Got an undefined number of tests at $0 line 20.\n");
4dd974da 20
82d700dc 21#line 24
b7f9bbeb 22ok !eval { $tb->plan(tests => 0) };
82d700dc 23is($@, "You said to run 0 tests at $0 line 24.\n");
4dd974da 24
ccbd73a4 25{
26 my $warning = '';
27 local $SIG{__WARN__} = sub { $warning .= join '', @_ };
28
3e887aae 29#line 31
ccbd73a4 30 ok $tb->plan(no_plan => 1);
3e887aae 31 is( $warning, "no_plan takes no arguments at $0 line 31.\n" );
ccbd73a4 32 is $tb->has_plan, 'no_plan';
33}