Plan 9 from Bell Labs’s /usr/web/sources/contrib/gabidiaz/root/sys/src/cmd/perl/lib/Test/t/mix.t

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


# -*-perl-*-
use strict;
use Test qw(:DEFAULT $TESTOUT $TESTERR $ntest);

### This test is crafted in such a way as to prevent Test::Harness from
### seeing the todo tests, otherwise you get people sending in bug reports
### about Test.pm having "UNEXPECTEDLY SUCCEEDED" tests.

open F, ">mix";
$TESTOUT = *F{IO};
$TESTERR = *F{IO};

plan tests => 4, todo => [2,3];

# line 15
ok(sub { 
       my $r = 0;
       for (my $x=0; $x < 10; $x++) {
	   $r += $x*($r+1);
       }
       $r
   }, 3628799);

ok(0);
ok(1);

skip(1,0);

close F;
$TESTOUT = *STDOUT{IO};
$TESTERR = *STDERR{IO};
$ntest = 1;

open F, "mix";
my $out = join '', <F>;
close F;
unlink "mix";

my $expect = <<"EXPECT";
1..4 todo 2 3;
ok 1
not ok 2
# Failed test 2 in $0 at line 23 *TODO*
ok 3 # ($0 at line 24 TODO?!)
ok 4 # skip
EXPECT


print "1..1\n";
ok( $out, $expect );

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].