tests for html escaping (jnareb)
Arthur Axel 'fREW' Schmidt [Fri, 11 Dec 2009 05:16:01 +0000 (23:16 -0600)]
t/tags.t

index 747382e..af792cb 100644 (file)
--- a/t/tags.t
+++ b/t/tags.t
@@ -31,6 +31,13 @@ use Test::More qw(no_plan);
     <woo ent="$ent">;
   }
 
+sub flaax {
+  use XML::Tags qw(woo);
+  my $data = "one&two<three>four";
+  <woo>,  $data, </woo>,
+  <woo>, \$data, </woo>;
+}
+
   sub globbery {
     <t/globbery/*>;
   }
@@ -63,6 +70,12 @@ is(
 );
 
 is(
+  join('', XML::Tags::to_xml_string Foo::flaax),
+  '<woo>one&amp;two&lt;three&gt;four</woo><woo>one&two<three>four</woo>',
+  'Escaping user data ok'
+);
+
+is(
   join(', ', Foo::globbery),
   't/globbery/one, t/globbery/two',
   'real glob re-installed ok'