This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
3111592e97fbd7922fef1a5b38c1d2890dea7a32
[perl5.git] / lib / Test / Simple / t / plan_no_plan.t
1 BEGIN {
2     if( $ENV{PERL_CORE} ) {
3         chdir 't';
4         @INC = '../lib';
5     }
6 }
7
8 use Test::More;
9
10 BEGIN {
11     if( !$ENV{HARNESS_ACTIVE} && $ENV{PERL_CORE} ) {
12         plan skip_all => "Won't work with t/TEST";
13     }
14 }
15
16 plan 'no_plan';
17
18 pass('Just testing');
19 ok(1, 'Testing again');
20
21 {
22     my $warning = '';
23     local $SIG{__WARN__} = sub { $warning = join "", @_ };
24     SKIP: {
25         skip 'Just testing skip with no_plan';
26         fail("So very failed");
27     }
28     is( $warning, '', 'skip with no "how_many" ok with no_plan' );
29
30
31     $warning = '';
32     TODO: {
33         todo_skip "Just testing todo_skip";
34
35         fail("Just testing todo");
36         die "todo_skip should prevent this";
37         pass("Again");
38     }
39     is( $warning, '', 'skip with no "how_many" ok with no_plan' );
40 }