LOGONLY mark 195c30 and b3fe9f as NODOC since they're tiny tweaks
[p5sagit/p5-mst-13.2.git] / cpan / Test / t / mix.t
CommitLineData
809908f7 1# -*-perl-*-
2use strict;
711cdd39 3use Test qw(:DEFAULT $TESTOUT $TESTERR $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
9open F, ">mix";
10$TESTOUT = *F{IO};
711cdd39 11$TESTERR = *F{IO};
edd5bad5 12
13plan tests => 4, todo => [2,3];
14
15# line 15
809908f7 16ok(sub {
17 my $r = 0;
18 for (my $x=0; $x < 10; $x++) {
19 $r += $x*($r+1);
20 }
21 $r
22 }, 3628799);
23
24ok(0);
25ok(1);
26
27skip(1,0);
edd5bad5 28
29close F;
30$TESTOUT = *STDOUT{IO};
711cdd39 31$TESTERR = *STDERR{IO};
edd5bad5 32$ntest = 1;
33
34open F, "mix";
35my $out = join '', <F>;
36close F;
37unlink "mix";
38
39my $expect = <<"EXPECT";
401..4 todo 2 3;
41ok 1
42not ok 2
43# Failed test 2 in $0 at line 23 *TODO*
44ok 3 # ($0 at line 24 TODO?!)
45ok 4 # skip
46EXPECT
47
48
75fa620a 49sub commentless {
50 my $in = $_[0];
51 $in =~ s/^#[^\n]*\n//mg;
52 $in =~ s/\n#[^\n]*$//mg;
53 return $in;
54}
55
56
edd5bad5 57print "1..1\n";
75fa620a 58ok( commentless($out), commentless($expect) );