4 if( $ENV{PERL_CORE} ) {
10 use Test::More tests => 17;
12 # If we skip with the same name, Test::Harness will report it back and
13 # we won't get lots of false bug reports.
14 my $Why = "Just testing the skip interface.";
18 unless Pigs->can('fly');
23 ok( $pig->altitude > 0, 'Pig is airborne' );
24 ok( $pig->airspeed > 0, ' and moving' );
29 skip "We're not skipping", 2 if 0;
31 pass("Inside skip block");
32 pass("Another inside");
37 skip "Again, not skipping", 2 if 0;
39 my($pack, $file, $line) = caller;
40 is( $pack || '', '', 'calling package not interfered with' );
41 is( $file || '', '', ' or file' );
42 is( $line || '', '', ' or line' );
49 die "A horrible death";
50 fail("Deliberate failure");
57 local $SIG{__WARN__} = sub { $warning = join "", @_ };
59 # perl gets the line number a little wrong on the first
60 # statement inside a block.
64 fail("So very failed");
66 is( $warning, "skip() needs to know \$how_many tests are in the ".
67 "block at $0 line 56\n",
68 'skip without $how_many warning' );
73 skip "Not skipping here.", 4 if 0;
75 pass("This is supposed to run");
77 # Testing out nested skips.
81 fail("You're a failure");
84 pass("This is supposed to run, too");
89 local $SIG{__WARN__} = sub { $warning .= join "", @_ };
92 skip 1, "This is backwards" if 1;
94 pass "This does not run";
97 like $warning, '/^skip\(\) was passed a non-numeric number of tests/';