BEGIN {
use
Test; plan
tests
=> 7 }
eval
join
''
, <DATA>;
my
(
$cgi
,
$s
);
eval
{
$cgi
= CGI::PrintWrapper->new (CGI::PrintWrapper::IO->new,
''
);
};
ok (not $@);
ok (
$cgi
);
eval
{
$cgi
->as_string;
$s
=
$cgi
->io->string;
};
ok (
$s
,
'<UL></UL>'
);
eval
{
$cgi
= CGI::PrintWrapper->new (CGI::PrintWrapper::IO->new,
''
);
$cgi
->cgi->param (
fred
=>
'barney'
);
$cgi
->cgi->param (
wilma
=>
qw(betty bam-bam dino)
);
$cgi
->as_string;
$s
=
$cgi
->io->string;
};
ok (
$s
,
<<EOS);
<UL>
<LI><STRONG>fred</STRONG>
<UL>
<LI>barney
</UL>
<LI><STRONG>wilma</STRONG>
<UL>
<LI>betty
<LI>bam-bam
<LI>dino
</UL>
</UL>
EOS
eval
{
$cgi
= CGI::PrintWrapper->new
(CGI::PrintWrapper::IO->new,
{
fred
=>
'barney'
,
wilma
=> [
qw(betty bam-bam dino)
]});
};
ok (not $@);
ok (
$cgi
);
eval
{
$cgi
->as_string;
$s
=
$cgi
->io->string;
};
ok (
$s
,
<<EOS);
<UL>
<LI><STRONG>fred</STRONG>
<UL>
<LI>barney
</UL>
<LI><STRONG>wilma</STRONG>
<UL>
<LI>betty
<LI>bam-bam
<LI>dino
</UL>
</UL>
EOS
1;