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