Commit | Line | Data |
809908f7 |
1 | # -*-perl-*- |
2 | use strict; |
edd5bad5 |
3 | use Test qw(:DEFAULT $TESTOUT $ntest); |
809908f7 |
4 | |
edd5bad5 |
5 | ### This test is crafted in such a way as to prevent Test::Harness from |
6 | ### seeing the todo tests, otherwise you get people sending in bug reports |
7 | ### about Test.pm having "UNEXPECTEDLY SUCCEEDED" tests. |
8 | |
9 | open F, ">mix"; |
10 | $TESTOUT = *F{IO}; |
11 | |
12 | plan tests => 4, todo => [2,3]; |
13 | |
14 | # line 15 |
809908f7 |
15 | ok(sub { |
16 | my $r = 0; |
17 | for (my $x=0; $x < 10; $x++) { |
18 | $r += $x*($r+1); |
19 | } |
20 | $r |
21 | }, 3628799); |
22 | |
23 | ok(0); |
24 | ok(1); |
25 | |
26 | skip(1,0); |
edd5bad5 |
27 | |
28 | close F; |
29 | $TESTOUT = *STDOUT{IO}; |
30 | $ntest = 1; |
31 | |
32 | open F, "mix"; |
33 | my $out = join '', <F>; |
34 | close F; |
35 | unlink "mix"; |
36 | |
37 | my $expect = <<"EXPECT"; |
38 | 1..4 todo 2 3; |
39 | ok 1 |
40 | not ok 2 |
41 | # Failed test 2 in $0 at line 23 *TODO* |
42 | ok 3 # ($0 at line 24 TODO?!) |
43 | ok 4 # skip |
44 | EXPECT |
45 | |
46 | |
47 | print "1..1\n"; |
48 | ok( $out, $expect ); |