X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Ftags.t;h=52dbc902c53370f3cad0f6d81abdc28b1b4c1d3e;hb=724b313633f9aa2d5e4e75018ec3af59ae4668ef;hp=747382ef102e568fc89801c2bd6e2cd5b2d85db1;hpb=0f339458a16fcc719f0a3f18e82c4212da460d99;p=catagits%2FWeb-Simple.git diff --git a/t/tags.t b/t/tags.t index 747382e..52dbc90 100644 --- a/t/tags.t +++ b/t/tags.t @@ -1,6 +1,8 @@ use strict; use warnings FATAL => 'all'; use Test::More qw(no_plan); +my $globbery; +BEGIN { $globbery = join(', ', ) } { package Foo; @@ -25,14 +27,42 @@ use Test::More qw(no_plan); , , "YAY", , ; } + sub xquux { + use HTML::Tags; + , + ,,,,
,'x',,1,,
; + } + sub fleem { use XML::Tags qw(woo); - my $ent = "one&two"; + my $ent = 'one&two"four'; ; } + sub flaax { + use XML::Tags qw(woo); + my $data = "one&twofour"; + , $data, , + , \$data, ; + } + + sub HTML_comment { + use HTML::Tags; + ; + } + + sub PI { + use XML::Tags; + ; + } + + sub DTD { + use HTML::Tags; + + } + sub globbery { - ; + ; } } @@ -57,13 +87,44 @@ is( ); is( + join('', HTML::Tags::to_html_string Foo::xquux), + '' . + '
x1
', + 'Conflicting HTML tags ok' +); + +is( + join('', XML::Tags::to_xml_string Foo::HTML_comment), + '', + 'HTML comment ok' +); + +is( join('', XML::Tags::to_xml_string Foo::fleem), - '', + '', 'Escaping ok' ); is( + join('', XML::Tags::to_xml_string Foo::flaax), + 'one&two<three>fourone&twofour', + 'Escaping user data ok' +); + +is( + join('', XML::Tags::to_xml_string Foo::PI), + '', + 'XML processing instruction' +); + +is( + join('', HTML::Tags::to_html_string Foo::DTD), + '', + 'DTD ok' +); + +is( join(', ', Foo::globbery), - 't/globbery/one, t/globbery/two', + $globbery, 'real glob re-installed ok' );