xref: /onnv-gate/usr/src/cmd/perl/5.8.4/distrib/lib/Test/Simple/t/todo.t (revision 0:68f95e015346)
1#!perl -w
2
3BEGIN {
4    if( $ENV{PERL_CORE} ) {
5        chdir 't';
6        @INC = '../lib';
7    }
8}
9
10BEGIN {
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
24TODO: {
25    local $TODO = $Why;
26
27    fail("Expected failure");
28    fail("Another expected failure");
29}
30
31
32pass("This is not todo");
33
34
35TODO: {
36    local $TODO = $Why;
37
38    fail("Yet another failure");
39}
40
41pass("This is still not todo");
42
43
44TODO: {
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
60TODO: {
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}
67