Add core switch to CGI.pm distribution tests
[p5sagit/p5-mst-13.2.git] / lib / CGI / t / pretty.t
1 #!/usr/local/bin/perl -w
2
3 BEGIN {
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
12 use strict;
13 use Test::More tests => 5;
14
15 BEGIN { use_ok('CGI::Pretty') };
16
17 # This is silly use_ok should take arguments
18 use CGI::Pretty (':all');
19
20 is(h1(), '<h1>',"single tag");
21
22 is(ol(li('fred'),li('ethel')), <<HTML,   "basic indentation");
23 <ol>
24         <li>
25                 fred
26         </li>
27         <li>
28                 ethel
29         </li>
30 </ol>
31 HTML
32
33
34 is(p('hi',pre('there'),'frog'), <<HTML, "<pre> tags");
35 <p>
36         hi <pre>there</pre>
37         frog
38 </p>
39 HTML
40
41
42 is(p('hi',a({-href=>'frog'},'there'),'frog'), <<HTML,   "as-is");
43 <p>
44         hi <a href="frog">there</a>
45         frog
46 </p>
47 HTML
48