t/tags.t: Test that XML processing instruction (<?xml ... ?>) works
Jakub Narebski [Sat, 12 Dec 2009 21:59:56 +0000 (22:59 +0100)]
We want to be able to e.g. put '<?xml version="1.0" encoding="UTF-8"?>'
XML declaration at the top of XHTML file.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>

t/tags.t

index 6c5a5e5..587bf63 100644 (file)
--- a/t/tags.t
+++ b/t/tags.t
@@ -38,6 +38,11 @@ use Test::More qw(no_plan);
     <woo>, \$data, </woo>;
   }
 
+  sub PI {
+    use XML::Tags;
+    <?xml version="1.0" encoding="UTF-8"?>;
+  }
+
   sub globbery {
     <t/globbery/*>;
   }
@@ -76,6 +81,12 @@ is(
 );
 
 is(
+  join('', XML::Tags::to_xml_string Foo::PI),
+  '<?xml version="1.0" encoding="UTF-8"?>',
+  'XML processing instruction'
+);
+
+is(
   join(', ', Foo::globbery),
   't/globbery/one, t/globbery/two',
   'real glob re-installed ok'