Commit | Line | Data |
33459055 |
1 | BEGIN { |
a9153838 |
2 | if( $ENV{PERL_CORE} ) { |
3 | chdir 't'; |
4 | @INC = '../lib'; |
5 | } |
33459055 |
6 | } |
7 | |
a9153838 |
8 | use Test::More; |
33459055 |
9 | |
a9153838 |
10 | BEGIN { |
11 | if( !$ENV{HARNESS_ACTIVE} && $ENV{PERL_CORE} ) { |
12 | plan skip_all => "Won't work with t/TEST"; |
13 | } |
33459055 |
14 | } |
15 | |
33459055 |
16 | BEGIN { |
17 | require Test::Harness; |
18 | } |
19 | |
30e302f8 |
20 | # This feature requires a fairly new version of Test::Harness |
21 | if( $Test::Harness::VERSION < 2.03 ) { |
22 | plan tests => 1; |
23 | diag "Need Test::Harness 2.03 or up. You have $Test::Harness::VERSION."; |
24 | fail 'Need Test::Harness 2.03 or up'; |
25 | exit; |
33459055 |
26 | } |
27 | |
30e302f8 |
28 | plan 'no_plan'; |
29 | |
33459055 |
30 | pass('Just testing'); |
31 | ok(1, 'Testing again'); |
0257f296 |
32 | |
33 | { |
34 | my $warning = ''; |
35 | local $SIG{__WARN__} = sub { $warning = join "", @_ }; |
36 | SKIP: { |
37 | skip 'Just testing skip with no_plan'; |
38 | fail("So very failed"); |
39 | } |
40 | is( $warning, '', 'skip with no "how_many" ok with no_plan' ); |
41 | |
42 | |
43 | $warning = ''; |
44 | TODO: { |
45 | todo_skip "Just testing todo_skip"; |
46 | |
47 | fail("Just testing todo"); |
48 | die "todo_skip should prevent this"; |
49 | pass("Again"); |
50 | } |
51 | is( $warning, '', 'skip with no "how_many" ok with no_plan' ); |
52 | } |