FAQ sync.
[p5sagit/p5-mst-13.2.git] / lib / CGI / t / pretty.t
CommitLineData
6b4ac661 1#!/usr/local/bin/perl -w
3d1a2ec4 2
f0c07f2e 3BEGIN {
4 chdir 't' if -d 't';
5 if ($ENV{PERL_CORE}) {
6 @INC = '../lib';
7 } else {
8 unshift @INC, qw( ../blib/lib ../blib/arch lib );
9 }
10}
11
ac734d8b 12use strict;
ac734d8b 13use Test::More tests => 5;
14
15BEGIN { use_ok('CGI::Pretty') };
16
17# This is silly use_ok should take arguments
18use CGI::Pretty (':all');
19
20is(h1(), '<h1>',"single tag");
21
22is(ol(li('fred'),li('ethel')), <<HTML, "basic indentation");
23<ol>
24 <li>
25 fred
26 </li>
27 <li>
28 ethel
29 </li>
30</ol>
31HTML
32
33
34is(p('hi',pre('there'),'frog'), <<HTML, "<pre> tags");
35<p>
6b4ac661 36 hi <pre>there</pre>
ac734d8b 37 frog
6b4ac661 38</p>
ac734d8b 39HTML
40
41
42is(p('hi',a({-href=>'frog'},'there'),'frog'), <<HTML, "as-is");
43<p>
6b4ac661 44 hi <a href="frog">there</a>
ac734d8b 45 frog
6b4ac661 46</p>
ac734d8b 47HTML
48