4 use Test qw($TESTOUT $TESTERR $ntest ok skip plan);
13 # Shut up deprecated usage warning.
19 $r |= ok(sub { 1+1 }, 3);
20 $r |= ok(sub { 1+1 }, sub { 2 * 0});
23 $r |= ok @list, 1, "\@list=".join(',',@list);
24 $r |= ok @list, 1, sub { "\@list=".join ',',@list };
25 $r |= ok 'segmentation fault', '/bongo/';
27 for (1..2) { $r |= ok(0); }
32 ok($r); # (failure==success :-)
35 $TESTOUT = *STDOUT{IO};
36 $TESTERR = *STDERR{IO};
41 while (<F>) { $O .= $_; }
45 ok join(' ', map { m/(\d+)/; $1 } grep /^not ok/, split /\n+/, $O),
48 my @got = split /not ok \d+\n/, $O;
52 my @expect = split /\n\n/, $Expect;
54 for (my $x=0; $x < @got; $x++) {
55 ok $got[$x], $expect[$x]."\n";
61 # Failed test 1 in $0 at line 15
63 # Failed test 2 in $0 at line 17
65 # Test 3 got: '0' ($0 at line 18)
68 # Test 4 got: '2' ($0 at line 19)
71 # Test 5 got: '2' ($0 at line 20)
74 # Test 6 got: '2' ($0 at line 23)
75 # Expected: '1' (\@list=0,0)
77 # Test 7 got: '2' ($0 at line 24)
78 # Expected: '1' (\@list=0,0)
80 # Test 8 got: 'segmentation fault' ($0 at line 25)
83 # Failed test 9 in $0 at line 27
85 # Failed test 10 in $0 at line 27 fail #2
87 # Failed test 11 in $0 at line 29
89 # Test 12 got: <UNDEF> ($0 at line 30)
92 # Failed test 13 in $0 at line 32