diff options
author | Charles Bailey <bailey@newman.upenn.edu> | 2000-05-23 23:35:13 +0000 |
---|---|---|
committer | bailey <bailey@newman.upenn.edu> | 2000-05-23 23:35:13 +0000 |
commit | ee8c7f5465f003860e2347a2946abacac39bd9b9 (patch) | |
tree | fb05d3d164ae556f95f63a324d3fbb66c4a36517 /t/lib/cgi-pretty.t | |
parent | 099f76bb8eab859fbb7b90260152c1ead1bf3022 (diff) | |
download | perl-ee8c7f5465f003860e2347a2946abacac39bd9b9.tar.gz |
Resync with mainline prior to post-5.6.0 updates
p4raw-id: //depot/vmsperl@6111
Diffstat (limited to 't/lib/cgi-pretty.t')
-rwxr-xr-x | t/lib/cgi-pretty.t | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/t/lib/cgi-pretty.t b/t/lib/cgi-pretty.t new file mode 100755 index 0000000000..e217a7dbd4 --- /dev/null +++ b/t/lib/cgi-pretty.t @@ -0,0 +1,39 @@ +#!./perl + +# Test ability to retrieve HTTP request info +######################### We start with some black magic to print on failure. +BEGIN { + chdir 't' if -d 't'; + unshift @INC, '../lib' if -d '../lib'; +} + +BEGIN {$| = 1; print "1..5\n"; } +END {print "not ok 1\n" unless $loaded;} +use CGI::Pretty (':standard','-no_debug','*h3','start_table'); +$loaded = 1; +print "ok 1\n"; + +######################### End of black magic. + +# util +sub test { + local($^W) = 0; + my($num, $true,$msg) = @_; + print($true ? "ok $num\n" : "not ok $num $msg\n"); +} + +# all the automatic tags +test(2,h1() eq '<H1>',"single tag"); +test(3,ol(li('fred'),li('ethel')) eq "<OL>\n\t<LI>\n\t\tfred\n\t</LI>\n\t <LI>\n\t\tethel\n\t</LI>\n</OL>\n","basic indentation"); +test(4,p('hi',pre('there'),'frog') eq +'<P> + hi <PRE>there</PRE> + frog +</P> +',"<pre> tags"); +test(5,p('hi',a({-href=>'frog'},'there'),'frog') eq +'<P> + hi <A HREF="frog">there</A> + frog +</P> +',"as-is"); |