develooper Front page | perl.perl5.porters | Postings from August 2001

Re: [PATCH pod/perlhack.pod t/op/pack.t] Fixing bad testing advice

From:
Michael G Schwern
Date:
August 27, 2001 18:24
Subject:
Re: [PATCH pod/perlhack.pod t/op/pack.t] Fixing bad testing advice
Message ID:
20010827212444.F12582@blackrider
On Tue, Aug 28, 2001 at 06:30:25AM +0530, Abhijit Menon-Sen wrote:
> At 2001-08-27 20:12:29, schwern@pobox.com wrote:
> > 
> > --- pod/perlhack.pod	2001/08/27 23:55:58	1.1
> > +++ pod/perlhack.pod	2001/08/28 00:11:18
> > @@ -1471,26 +1471,40 @@
> 
> Thanks, applied. (#11767)

Ooopsie.  That ok() function will cause problems on VMS.

--- pod/perlhack.pod	2001/08/28 01:20:47	1.1
+++ pod/perlhack.pod	2001/08/28 01:21:35
@@ -1482,8 +1482,13 @@
     my $test = 1;
     sub ok {
         my($ok) = @_;
-        print "not " unless $ok;
-        print "ok $test\n";
+
+        # You have to do it this way or VMS will get confused.
+        my $out = '';
+        $out =  "not " unless $ok;
+        $out .= "ok $test\n";
+        print $out;
+
         $test++;
         return $ok;
     }
--- t/op/pack.t	2001/08/28 01:22:51	1.2
+++ t/op/pack.t	2001/08/28 01:23:14
@@ -12,11 +12,17 @@
 my $test = 1;
 sub ok {
     my($ok) = @_;
-    print "not " unless $ok;
-    print "ok $test\n";
+
+    # You have to do it this way or VMS will get confused.
+    my $out = '';
+    $out =  "not " unless $ok;
+    $out .= "ok $test\n";
+    print $out;
+
     $test++;
     return $ok;
 }
+
 
 print "1..161\n";
 


-- 

Michael G. Schwern   <schwern@pobox.com>    http://www.pobox.com/~schwern/
Perl6 Quality Assurance     <perl-qa@perl.org>	     Kwalitee Is Job One
"Let's face it," said bearded Rusty Simmons, opening a can after the
race.  "This is a good excuse to drink some beer."  At 10:30 in the
morning?  "Well, it's past noon in Dublin," said teammate Mike
[Joseph] Schwern.  "It's our duty."
    -- "Sure, and It's a Great Day for Irish Runners" 
       Newsday, Sunday, March 20, 1988



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About