diff options
author | Peter Prymmer <PPrymmer@factset.com> | 2000-08-23 06:58:31 -0700 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2000-08-25 17:01:18 +0000 |
commit | 1e846b39a9b9b392d59f44058306b22437dc032a (patch) | |
tree | cda0d96f18d825c016ace3c0842fe4b885a8566f /t | |
parent | 32f78baf72351c617b69c24c7d8f114f5fd2d837 (diff) | |
download | perl-1e846b39a9b9b392d59f44058306b22437dc032a.tar.gz |
Missing parts of
Subject: [PATCH: 6789] some endl fixes for VMS wackiness
Message-ID: <Pine.OSF.4.10.10008231351000.126820-100000@aspara.forte.com>
p4raw-id: //depot/perl@6810
Diffstat (limited to 't')
-rwxr-xr-x | t/lib/cgi-html.t | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/t/lib/cgi-html.t b/t/lib/cgi-html.t index a1ebe9e08a..a49388bf6f 100755 --- a/t/lib/cgi-html.t +++ b/t/lib/cgi-html.t @@ -24,6 +24,14 @@ sub test { print($true ? "ok $num\n" : "not ok $num $msg\n"); } +my $CRLF = "\015\012"; +if ($^O eq 'VMS') { + $CRLF = "\n"; # via web server carriage is inserted automatically +} +if (ord("\t") != 9) { # EBCDIC? + $CRLF = "\r\n"; +} + # all the automatic tags test(2,h1() eq '<h1 />',"single tag"); test(3,h1('fred') eq '<h1>fred</h1>',"open/close tag"); @@ -37,10 +45,17 @@ test(7,h1({-align=>'CENTER'},['fred','agnes']) eq 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" |