| 1 | # -*-perl-*-
|
|---|
| 2 | use strict;
|
|---|
| 3 | use Test qw(:DEFAULT $TESTOUT $TESTERR $ntest);
|
|---|
| 4 |
|
|---|
| 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, ">todo";
|
|---|
| 10 | $TESTOUT = *F{IO};
|
|---|
| 11 | $TESTERR = *F{IO};
|
|---|
| 12 | my $tests = 5;
|
|---|
| 13 | plan tests => $tests, todo => [2..$tests];
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 | # tests to go to the output file
|
|---|
| 17 | ok(1);
|
|---|
| 18 | ok(1);
|
|---|
| 19 | ok(0,1);
|
|---|
| 20 | ok(0,1,"need more tuits");
|
|---|
| 21 | ok(1,1);
|
|---|
| 22 |
|
|---|
| 23 | close F;
|
|---|
| 24 | $TESTOUT = *STDOUT{IO};
|
|---|
| 25 | $TESTERR = *STDERR{IO};
|
|---|
| 26 | $ntest = 1;
|
|---|
| 27 |
|
|---|
| 28 | open F, "todo";
|
|---|
| 29 | my $out = join '', <F>;
|
|---|
| 30 | close F;
|
|---|
| 31 | unlink "todo";
|
|---|
| 32 |
|
|---|
| 33 | my $expect = <<"EXPECT";
|
|---|
| 34 | 1..5 todo 2 3 4 5;
|
|---|
| 35 | ok 1
|
|---|
| 36 | ok 2 # ($0 at line 18 TODO?!)
|
|---|
| 37 | not ok 3
|
|---|
| 38 | # Test 3 got: '0' ($0 at line 19 *TODO*)
|
|---|
|
|---|