X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCGI%2Ft%2Fhtml.t;h=b3c462c07906bd867c2d7beb4d0a092faddad7dd;hb=8f3ccfa25e524ac7012f7d988353f2de4c217ccb;hp=1af6754b33047f2267d043bb0b18a6085578eb82;hpb=13e345655fd69fad07c7c1d3f491abb9523bfcbd;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/CGI/t/html.t b/lib/CGI/t/html.t index 1af6754..b3c462c 100755 --- a/lib/CGI/t/html.t +++ b/lib/CGI/t/html.t @@ -1,30 +1,21 @@ #!/usr/local/bin/perl -w -BEGIN { - chdir 't' if -d 't'; - if ($ENV{PERL_CORE}) { - @INC = '../lib'; - } else { - # Due to a bug in older versions of MakeMaker & Test::Harness, - # we must ensure the blib's are in @INC, else we might use - # the core CGI.pm - unshift @INC, qw( ../blib/lib ../blib/arch ../lib ); - } -} # Test ability to retrieve HTTP request info ######################### We start with some black magic to print on failure. +use lib '../blib/lib','../blib/arch'; -BEGIN {$| = 1; print "1..24\n"; } END {print "not ok 1\n" unless $loaded;} use CGI (':standard','-no_debug','*h3','start_table'); $loaded = 1; print "ok 1\n"; BEGIN { - if ($] >= 5.006) { - require utf8; # we contain Latin-1 in subtest #22, - utf8->unimport; # possible "use utf8" must be undone - } + $| = 1; print "1..27\n"; + if( $] > 5.006 ) { + # no utf8 + require utf8; # we contain Latin-1 + utf8->unimport; + } } ######################### End of black magic. @@ -105,3 +96,9 @@ test(22,h1(escapeHTML("this is \x8bright\x9b")) eq '

this is <not> test(23,i(p('hello there')) eq '

hello there

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

hi

'); + +$q->autoEscape(1); +test(25,$q->p({title=>"hello worldè"},'hello á') eq '

hello á

'); +$q->autoEscape(0); +test(26,$q->p({title=>"hello worldè"},'hello á') eq '

hello á

'); +test(27,p({title=>"hello worldè"},'hello á') eq '

hello á

');