Fix escaping of '"' in XML::Tags::to_xml_string
[catagits/Web-Simple.git] / t / tags.t
index 6c5a5e5..46e5c8a 100644 (file)
--- a/t/tags.t
+++ b/t/tags.t
@@ -27,7 +27,7 @@ use Test::More qw(no_plan);
 
   sub fleem {
     use XML::Tags qw(woo);
-    my $ent = "one&two";
+    my $ent = 'one&two<three>"four';
     <woo ent="$ent">;
   }
 
@@ -38,6 +38,16 @@ use Test::More qw(no_plan);
     <woo>, \$data, </woo>;
   }
 
+  sub PI {
+    use XML::Tags;
+    <?xml version="1.0" encoding="UTF-8"?>;
+  }
+
+  sub DTD {
+    use HTML::Tags;
+    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+  }
+
   sub globbery {
     <t/globbery/*>;
   }
@@ -65,7 +75,7 @@ is(
 
 is(
   join('', XML::Tags::to_xml_string Foo::fleem),
-  '<woo ent="one&amp;two">',
+  '<woo ent="one&amp;two&lt;three&gt;&quot;four">',
   'Escaping ok'
 );
 
@@ -76,6 +86,18 @@ is(
 );
 
 is(
+  join('', XML::Tags::to_xml_string Foo::PI),
+  '<?xml version="1.0" encoding="UTF-8"?>',
+  'XML processing instruction'
+);
+
+is(
+  join('', HTML::Tags::to_html_string Foo::DTD),
+  '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">',
+  'DTD ok'
+);
+
+is(
   join(', ', Foo::globbery),
   't/globbery/one, t/globbery/two',
   'real glob re-installed ok'