X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2Fcgi-html.t;h=1e20a315fafc02235f153c726873603b5c9b0a5f;hb=3d1a2ec4907585a079fab9dc4764c16e7e3b58e3;hp=43d41ec10fe4548befcc4403b567576bf4b96a91;hpb=f3248e5040f8dfad4ae7c7de65d22997a0107c5f;p=p5sagit%2Fp5-mst-13.2.git diff --git a/t/lib/cgi-html.t b/t/lib/cgi-html.t index 43d41ec..1e20a31 100755 --- a/t/lib/cgi-html.t +++ b/t/lib/cgi-html.t @@ -9,7 +9,7 @@ BEGIN { require Config; import Config; } -BEGIN {$| = 1; print "1..20\n"; } +BEGIN {$| = 1; print "1..24\n"; } END {print "not ok 1\n" unless $loaded;} use CGI (':standard','-no_debug','*h3','start_table'); $loaded = 1; @@ -41,12 +41,13 @@ test(7,h1({-align=>'CENTER'},['fred','agnes']) eq test(8,h1('fred','agnes','maura') eq '

fred-agnes-maura

',"open/close tag \$\" interpolation"); } -test(9,header() eq "Content-Type: text/html$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$crlf$crlf","header()"); +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; charset=ISO-8859-1$crlf$crlf","header()"); +test(11,header(-type=>'image/gif',-status=>'500 Sucks') eq "Status: 500 Sucks${crlf}Content-Type: image/gif; charset=ISO-8859-1$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 < + Untitled Document END @@ -58,7 +59,8 @@ test(14,start_html(-dtd=>"-//IETF//DTD HTML 3.2//FR") ."\n" eq <'The world of foo') ."\n" eq < + The world of foo END @@ -70,6 +72,9 @@ test(17,header(-Cookie=>$cookie) =~ m!^Set-Cookie: fred=chocolate&chip\; path=/$ test(18,start_h3 eq '

'); test(19,end_h3 eq '

'); test(20,start_table({-border=>undef}) eq ''); - - - +test(21,h1(escapeHTML("this is \x8bright\x9b")) eq '

this is <not> ‹right›

'); +charset('utf-8'); +test(22,h1(escapeHTML("this is \x8bright\x9b")) eq '

this is <not> ‹right›

'); +test(23,i(p('hello there')) eq '

hello there

'); +my $q = new CGI; +test(24,$q->h1('hi') eq '

hi

');