From: Peter Prymmer Date: Fri, 23 Feb 2001 10:51:37 +0000 (-0800) Subject: Re: [PATCH: perl 5.005_03] Record I/O fix for Test.pm in older perl X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e542038281114e9ad7ceaa6c95bec02e681da55a;p=p5sagit%2Fp5-mst-13.2.git Re: [PATCH: perl 5.005_03] Record I/O fix for Test.pm in older perl Message-ID: p4raw-id: //depot/perl@8949 --- diff --git a/lib/Test.pm b/lib/Test.pm index 4a38d54..89b9cec 100644 --- a/lib/Test.pm +++ b/lib/Test.pm @@ -86,11 +86,13 @@ sub ok ($;$$) { # on a separate line and would not get counted as failures. #print $TESTOUT "not " if !$ok; #print $TESTOUT "ok $ntest\n"; - # Replace with a single print() as a workaround: - my $okline = ''; - $okline = "not " if !$ok; - $okline .= "ok $ntest\n"; - print $TESTOUT $okline; + # 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,