This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #123963] "@<fullwidth digit>"
[perl5.git] / cpan / Test-Simple / t / Legacy / no_plan.t
1 #!/usr/bin/perl -w
2
3 BEGIN {
4     if( $ENV{PERL_CORE} ) {
5         chdir 't';
6         @INC = ('../lib', 'lib');
7     }
8     else {
9         unshift @INC, 't/lib';
10     }
11 }
12
13 use Test::More tests => 7;
14
15 my $tb = Test::Builder->create;
16
17 #line 20
18 ok !eval { $tb->plan(tests => undef) };
19 is($@, "Got an undefined number of tests at $0 line 20.\n");
20
21 #line 24
22 ok !eval { $tb->plan(tests => 0) };
23 is($@, "You said to run 0 tests at $0 line 24.\n");
24
25 {
26     my $warning = '';
27     local $SIG{__WARN__} = sub { $warning .= join '', @_ };
28
29 #line 31
30     ok $tb->plan(no_plan => 1);
31     is( $warning, "no_plan takes no arguments at $0 line 31.\n" );
32     is $tb->has_plan, 'no_plan';
33 }