Update to CGI 2.70, from Lincoln Stein.
[p5sagit/p5-mst-13.2.git] / t / lib / cgi-pretty.t
CommitLineData
6b4ac661 1#!/usr/local/bin/perl -w
3d1a2ec4 2
3# Test ability to retrieve HTTP request info
4######################### We start with some black magic to print on failure.
6b4ac661 5use lib '../blib/lib','../blib/arch';
3d1a2ec4 6
7BEGIN {$| = 1; print "1..5\n"; }
8END {print "not ok 1\n" unless $loaded;}
9use CGI::Pretty (':standard','-no_debug','*h3','start_table');
10$loaded = 1;
11print "ok 1\n";
12
13######################### End of black magic.
14
15# util
16sub test {
17 local($^W) = 0;
18 my($num, $true,$msg) = @_;
19 print($true ? "ok $num\n" : "not ok $num $msg\n");
20}
21
22# all the automatic tags
6b4ac661 23test(2,h1() eq '<h1>',"single tag");
24test(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");
3d1a2ec4 25test(4,p('hi',pre('there'),'frog') eq
6b4ac661 26'<p>
27 hi <pre>there</pre>
3d1a2ec4 28 frog
6b4ac661 29</p>
3d1a2ec4 30',"<pre> tags");
31test(5,p('hi',a({-href=>'frog'},'there'),'frog') eq
6b4ac661 32'<p>
33 hi <a href="frog">there</a>
3d1a2ec4 34 frog
6b4ac661 35</p>
3d1a2ec4 36',"as-is");