X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FTest.pm;h=19a9089978208d9332b29b0481c2d786edb1062f;hb=191740791d4b6865c4f2665c148ea4f4d8ec7cc3;hp=c18d3812e52057251be56b2a61597de6f4228bcc;hpb=99e89e1e858bb38487deb1f7e553bcf4759385b8;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/Test.pm b/lib/Test.pm index c18d381..19a9089 100644 --- a/lib/Test.pm +++ b/lib/Test.pm @@ -4,7 +4,7 @@ use Test::Harness 1.1601 (); use Carp; our($VERSION, @ISA, @EXPORT, @EXPORT_OK, $ntest, $TestLevel); #public-ish our($TESTOUT, $ONFAIL, %todo, %history, $planned, @FAILDETAIL); #private-ish -$VERSION = '1.14'; +$VERSION = '1.15'; require Exporter; @ISA=('Exporter'); @EXPORT=qw(&plan &ok &skip); @@ -81,8 +81,18 @@ sub ok ($;$$) { $context .= ' TODO?!' if $todo; print $TESTOUT "ok $ntest # ($context)\n"; } else { - print $TESTOUT "not " if !$ok; - print $TESTOUT "ok $ntest\n"; + # Issuing two separate print()s causes severe trouble with + # Test::Harness on VMS. The "not "'s for failed tests occur + # on a separate line and would not get counted as failures. + #print $TESTOUT "not " if !$ok; + #print $TESTOUT "ok $ntest\n"; + # Replace with one of a pair of single print()'s as a workaround: + if (!$ok) { + print $TESTOUT "not ok $ntest\n"; + } + else { + print $TESTOUT "ok $ntest\n"; + } if (!$ok) { my $detail = { 'repetition' => $repetition, 'package' => $pkg, @@ -141,7 +151,7 @@ __END__ =head1 NAME - Test - provides a simple framework for writing test scripts +Test - provides a simple framework for writing test scripts =head1 SYNOPSIS @@ -177,9 +187,9 @@ __END__ =head1 DESCRIPTION -L expects to see particular output when it executes -tests. This module aims to make writing proper test scripts just a -little bit easier (and less error prone :-). +L expects to see particular output when it +executes tests. This module aims to make writing proper test scripts just +a little bit easier (and less error prone :-). =head1 TEST TYPES