Commit | Line | Data |
33459055 |
1 | #!perl -w |
2 | |
d020a79a |
3 | BEGIN { |
a9153838 |
4 | if( $ENV{PERL_CORE} ) { |
5 | chdir 't'; |
6 | @INC = '../lib'; |
7 | } |
33459055 |
8 | } |
9 | |
30e302f8 |
10 | require Test::Harness; |
11 | use 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 |
15 | if( $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 | |
7483b81c |
21 | plan tests => 16; |
30e302f8 |
22 | |
23 | |
d020a79a |
24 | $Why = 'Just testing the todo interface.'; |
25 | |
7483b81c |
26 | my $is_todo; |
d020a79a |
27 | TODO: { |
28 | local $TODO = $Why; |
29 | |
30 | fail("Expected failure"); |
31 | fail("Another expected failure"); |
d020a79a |
32 | |
7483b81c |
33 | $is_todo = Test::More->builder->todo; |
34 | } |
d020a79a |
35 | |
36 | pass("This is not todo"); |
7483b81c |
37 | ok( $is_todo, 'TB->todo' ); |
d020a79a |
38 | |
39 | |
40 | TODO: { |
41 | local $TODO = $Why; |
42 | |
43 | fail("Yet another failure"); |
44 | } |
45 | |
46 | pass("This is still not todo"); |
0cd946aa |
47 | |
48 | |
49 | TODO: { |
50 | local $TODO = "testing that error messages don't leak out of todo"; |
51 | |
52 | ok( 'this' eq 'that', 'ok' ); |
53 | |
54 | like( 'this', '/that/', 'like' ); |
55 | is( 'this', 'that', 'is' ); |
56 | isnt( 'this', 'this', 'isnt' ); |
57 | |
58 | can_ok('Fooble', 'yarble'); |
59 | isa_ok('Fooble', 'yarble'); |
60 | use_ok('Fooble'); |
61 | require_ok('Fooble'); |
62 | } |
a9153838 |
63 | |
64 | |
65 | TODO: { |
66 | todo_skip "Just testing todo_skip", 2; |
67 | |
68 | fail("Just testing todo"); |
69 | die "todo_skip should prevent this"; |
70 | pass("Again"); |
71 | } |