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 | |
30e302f8 |
21 | plan tests => 15; |
22 | |
23 | |
d020a79a |
24 | $Why = 'Just testing the todo interface.'; |
25 | |
26 | TODO: { |
27 | local $TODO = $Why; |
28 | |
29 | fail("Expected failure"); |
30 | fail("Another expected failure"); |
31 | } |
32 | |
33 | |
34 | pass("This is not todo"); |
35 | |
36 | |
37 | TODO: { |
38 | local $TODO = $Why; |
39 | |
40 | fail("Yet another failure"); |
41 | } |
42 | |
43 | pass("This is still not todo"); |
0cd946aa |
44 | |
45 | |
46 | TODO: { |
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 | |
62 | TODO: { |
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 | } |