4 if( $ENV{PERL_CORE} ) {
10 require Test::Harness;
13 # Shut up a "used only once" warning in 5.5.4.
14 my $th_version = $Test::Harness::VERSION = $Test::Harness::VERSION;
15 $th_version =~ s/_//; # for X.Y_Z alpha versions
17 # TODO requires a fairly new version of Test::Harness
18 if( $th_version < 2.03 ) {
20 fail "Need Test::Harness 2.03 or up. You have $th_version.";
27 $Why = 'Just testing the todo interface.';
33 fail("Expected failure");
34 fail("Another expected failure");
36 $is_todo = Test::More->builder->todo;
39 pass("This is not todo");
40 ok( $is_todo, 'TB->todo' );
46 fail("Yet another failure");
49 pass("This is still not todo");
53 local $TODO = "testing that error messages don't leak out of todo";
55 ok( 'this' eq 'that', 'ok' );
57 like( 'this', '/that/', 'like' );
58 is( 'this', 'that', 'is' );
59 isnt( 'this', 'this', 'isnt' );
61 can_ok('Fooble', 'yarble');
62 isa_ok('Fooble', 'yarble');
69 todo_skip "Just testing todo_skip", 2;
71 fail("Just testing todo");
72 die "todo_skip should prevent this";
79 local $SIG{__WARN__} = sub { $warning = join "", @_ };
81 # perl gets the line number a little wrong on the first
82 # statement inside a block.
85 todo_skip "Just testing todo_skip";
86 fail("So very failed");
88 is( $warning, "todo_skip() needs to know \$how_many tests are in the ".
89 "block at $0 line 82\n",
90 'todo_skip without $how_many warning' );