X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Ftags.t;h=af792cb610aabfadbf57ab8b21b4c84d520dcebd;hb=9935bd6c7784067280343c2874336e3ca7c82000;hp=fa53f80575489221393bcaecc3b3173ba9ad9f5f;hpb=cc050137def024a8d94bc86a46bd3d7af495cf18;p=catagits%2FWeb-Simple.git
diff --git a/t/tags.t b/t/tags.t
index fa53f80..af792cb 100644
--- a/t/tags.t
+++ b/t/tags.t
@@ -24,10 +24,27 @@ use Test::More qw(no_plan);
use HTML::Tags;
,
, "YAY", , ;
}
+
+ sub fleem {
+ use XML::Tags qw(woo);
+ my $ent = "one&two";
+ ;
+ }
+
+sub flaax {
+ use XML::Tags qw(woo);
+ my $data = "one&twofour";
+ , $data, ,
+ , \$data, ;
+}
+
+ sub globbery {
+ ;
+ }
}
is(
- join(', ', XML::Tags::sanitize Foo::foo()),
+ join(', ', XML::Tags::to_xml_string Foo::foo()),
', , ',
'open tags ok'
);
@@ -35,13 +52,31 @@ is(
ok(!eval { Foo::bar(); 1 }, 'Death on use of unimported tag');
is(
- join(', ', XML::Tags::sanitize Foo::baz()),
+ join(', ', XML::Tags::to_xml_string Foo::baz()),
'',
'close tag ok'
);
is(
- join('', XML::Tags::sanitize Foo::quux),
+ join('', HTML::Tags::to_html_string Foo::quux),
'YAY',
'HTML tags 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(', ', Foo::globbery),
+ 't/globbery/one, t/globbery/two',
+ 'real glob re-installed ok'
+);