use overload::constant to escape attributes within <foo ...>
[catagits/Web-Simple.git] / t / tags.t
index 9979e7f..747382e 100644 (file)
--- a/t/tags.t
+++ b/t/tags.t
@@ -25,6 +25,12 @@ use Test::More qw(no_plan);
     <html>, <body id="spoon">, "YAY", </body>, </html>;
   }
 
+  sub fleem {
+    use XML::Tags qw(woo);
+    my $ent = "one&two";
+    <woo ent="$ent">;
+  }
+
   sub globbery {
     <t/globbery/*>;
   }
@@ -51,6 +57,12 @@ is(
 );
 
 is(
+  join('', XML::Tags::to_xml_string Foo::fleem),
+  '<woo ent="one&amp;two">',
+  'Escaping ok'
+);
+
+is(
   join(', ', Foo::globbery),
   't/globbery/one, t/globbery/two',
   'real glob re-installed ok'