On Tue, 15 Aug 2000, Jarkko Hietaniemi wrote:

> > Cool.  Thanks.
> > 
> 
> The 6640 also has a newer File::Temp.
> 
> The CGI failure is surprising.

Actually it appears to be the same problem we saw just recently:  CGI.pm
is set up to put a "\n" on VMS because a carriage return automatically
gets inserted into the output stream when writing records to a webserver
"socket" (so my question is "Were we running this test before?" or "Why
didn't this turn up before?"). The tests are not set up to accomodate
that, hence:

not ok 9 header()
not ok 10 header()
not ok 11 header()
not ok 12 header()

Here is a patch to cgi-html.t that checks out OK on VMS and Tru64:

--- t/lib/cgi-html.t.orig       Sun Aug 13 11:36:38 2000
+++ t/lib/cgi-html.t    Tue Aug 15 11:33:43 2000
@@ -37,10 +37,17 @@
     local($") = '-'; 
     test(8,h1('fred','agnes','maura') eq '<h1>fred-agnes-maura</h1>',"open/close tag 
\$\" interpolation");
 }
-test(9,header() eq "Content-Type: text/html; 
charset=ISO-8859-1\015\012\015\012","header()");
-test(10,header(-type=>'image/gif') eq "Content-Type: 
image/gif\015\012\015\012","header()");
-test(11,header(-type=>'image/gif',-status=>'500 Sucks') eq "Status: 500 
Sucks\015\012Content-Type: image/gif\015\012\015\012","header()");
-test(12,header(-nph=>1) eq "HTTP/1.0 200 OK\015\012Content-Type: text/html; 
charset=ISO-8859-1\015\012\015\012","header()");
+my $CRLF = "\015\012";
+if ($^O eq 'VMS') { 
+    $CRLF = "\n"; # only on a webserver does a \r get inserted
+}
+if (ord("\t") != 9) { 
+    $CRLF = "\r\n"; # EBCDIC CRLF
+}
+test(9,header() eq "Content-Type: text/html; 
+charset=ISO-8859-1$CRLF$CRLF","header()");
+test(10,header(-type=>'image/gif') eq "Content-Type: image/gif$CRLF$CRLF","header()");
+test(11,header(-type=>'image/gif',-status=>'500 Sucks') eq "Status: 500 
+Sucks${CRLF}Content-Type: image/gif$CRLF$CRLF","header()");
+test(12,header(-nph=>1) eq "HTTP/1.0 200 OK${CRLF}Content-Type: text/html; 
+charset=ISO-8859-1$CRLF$CRLF","header()");
 test(13,start_html() ."\n" eq <<END,"start_html()");
 <!DOCTYPE HTML
        PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
End of Patch.

Peter Prymmer



Reply via email to