#!/bin/perl -w use strict; use lib '.', 't/lib','../blib/lib','./blib/lib'; use Test::More tests => 18; BEGIN { use_ok('CGI::Pretty') }; # This is silly use_ok should take arguments use CGI::Pretty (':all'); is(h1(), '

',"single tag"); is(ol(li('fred'),li('ethel')), <
  • fred
  • ethel
  • HTML is(p('hi',pre('there'),'frog'), < tags");

    hi

    there
    frog

    HTML is(h1({-align=>'CENTER'},'fred'), < fred

    HTML is(h1({-align=>undef},'fred'), < fred HTML is(h1({-align=>'CENTER'},['fred','agnes']), < fred

    agnes

    HTML is(p('hi',a({-href=>'frog'},'there'),'frog'), < hi there frog

    HTML is(p([ qw( hi there frog ) ] ), < hi

    there

    frog

    HTML is(p(p(p('hi'), 'there' ), 'frog'), <

    hi

    there

    frog

    HTML is(table(TR(td(table(TR(td('hi', 'there', 'frog')))))), <
    hi there frog
    HTML is(table(TR(td(table(TR(td( [ qw( hi there frog ) ])))))), <
    hi there frog
    HTML $CGI::Pretty::INDENT = $CGI::Pretty::LINEBREAK = ""; is(h1(), '

    ',"single tag (pretty turned off)"); is(h1('fred'), '

    fred

    ',"open/close tag (pretty turned off)"); is(h1('fred','agnes','maura'), '

    fred agnes maura

    ',"open/close tag multiple (pretty turned off)"); is(h1({-align=>'CENTER'},'fred'), '

    fred

    ',"open/close tag with attribute (pretty turned off)"); is(h1({-align=>undef},'fred'), '

    fred

    ',"open/close tag with orphan attribute (pretty turned off)"); is(h1({-align=>'CENTER'},['fred','agnes']), '

    fred

    agnes

    ', "distributive tag with attribute (pretty turned off)");