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