Add ARM files
[dh-make-perl] / dev / arm / libtest-simple-perl / libtest-simple-perl-0.80 / t / todo.t
1 #!perl -w
2
3 BEGIN {
4     if( $ENV{PERL_CORE} ) {
5         chdir 't';
6         @INC = '../lib';
7     }
8 }
9
10 use Test::More;
11
12 plan tests => 19;
13
14
15 $Why = 'Just testing the todo interface.';
16
17 my $is_todo;
18 TODO: {
19     local $TODO = $Why;
20
21     fail("Expected failure");
22     fail("Another expected failure");
23
24     $is_todo = Test::More->builder->todo;
25 }
26
27 pass("This is not todo");
28 ok( $is_todo, 'TB->todo' );
29
30
31 TODO: {
32     local $TODO = $Why;
33
34     fail("Yet another failure");
35 }
36
37 pass("This is still not todo");
38
39
40 TODO: {
41     local $TODO = "testing that error messages don't leak out of todo";
42
43     ok( 'this' eq 'that',   'ok' );
44
45     like( 'this', '/that/', 'like' );
46     is(   'this', 'that',   'is' );
47     isnt( 'this', 'this',   'isnt' );
48
49     can_ok('Fooble', 'yarble');
50     isa_ok('Fooble', 'yarble');
51     use_ok('Fooble');
52     require_ok('Fooble');
53 }
54
55
56 TODO: {
57     todo_skip "Just testing todo_skip", 2;
58
59     fail("Just testing todo");
60     die "todo_skip should prevent this";
61     pass("Again");
62 }
63
64
65 {
66     my $warning;
67     local $SIG{__WARN__} = sub { $warning = join "", @_ };
68     TODO: {
69         # perl gets the line number a little wrong on the first
70         # statement inside a block.
71         1 == 1;
72 #line 73
73         todo_skip "Just testing todo_skip";
74         fail("So very failed");
75     }
76     is( $warning, "todo_skip() needs to know \$how_many tests are in the ".
77                   "block at $0 line 73\n",
78         'todo_skip without $how_many warning' );
79 }
80
81
82 TODO: {
83     Test::More->builder->exported_to("Wibble");
84     
85     local $TODO = "testing \$TODO with an incorrect exported_to()";
86     
87     fail("Just testing todo");
88 }