Assimilate Test-Simple 0.50
[p5sagit/p5-mst-13.2.git] / lib / Test / Simple / t / todo.t
CommitLineData
33459055 1#!perl -w
2
d020a79a 3BEGIN {
a9153838 4 if( $ENV{PERL_CORE} ) {
5 chdir 't';
6 @INC = '../lib';
7 }
33459055 8}
9
30e302f8 10require Test::Harness;
11use Test::More;
12
13# This feature requires a fairly new version of Test::Harness
14(my $th_version = $Test::Harness::VERSION) =~ s/_//; # for X.Y_Z alpha versions
15if( $th_version < 2.03 ) {
16 plan tests => 1;
17 fail "Need Test::Harness 2.03 or up. You have $th_version.";
18 exit;
d020a79a 19}
20
30e302f8 21plan tests => 15;
22
23
d020a79a 24$Why = 'Just testing the todo interface.';
25
26TODO: {
27 local $TODO = $Why;
28
29 fail("Expected failure");
30 fail("Another expected failure");
31}
32
33
34pass("This is not todo");
35
36
37TODO: {
38 local $TODO = $Why;
39
40 fail("Yet another failure");
41}
42
43pass("This is still not todo");
0cd946aa 44
45
46TODO: {
47 local $TODO = "testing that error messages don't leak out of todo";
48
49 ok( 'this' eq 'that', 'ok' );
50
51 like( 'this', '/that/', 'like' );
52 is( 'this', 'that', 'is' );
53 isnt( 'this', 'this', 'isnt' );
54
55 can_ok('Fooble', 'yarble');
56 isa_ok('Fooble', 'yarble');
57 use_ok('Fooble');
58 require_ok('Fooble');
59}
a9153838 60
61
62TODO: {
63 todo_skip "Just testing todo_skip", 2;
64
65 fail("Just testing todo");
66 die "todo_skip should prevent this";
67 pass("Again");
68}