reinstate the right glob in XML::Tags (RT#120071)
[catagits/Web-Simple.git] / t / tags.t
index 46e5c8a..52dbc90 100644 (file)
--- a/t/tags.t
+++ b/t/tags.t
@@ -1,6 +1,8 @@
 use strict; use warnings FATAL => 'all';
 use Test::More qw(no_plan);
 
+my $globbery;
+BEGIN { $globbery = join(', ', <t/globbery/o* t/globbery/t*>) }
 {
 
   package Foo;
@@ -25,6 +27,12 @@ use Test::More qw(no_plan);
     <html>, <body id="spoon">, "YAY", </body>, </html>;
   }
 
+  sub xquux {
+    use HTML::Tags;
+    <link href="#self" rel="me" />,
+    <table>,<tr>,<td>,'x',<sub>,1,</sub>,</td>,</tr>,</table>;
+  }
+
   sub fleem {
     use XML::Tags qw(woo);
     my $ent = 'one&two<three>"four';
@@ -38,6 +46,11 @@ use Test::More qw(no_plan);
     <woo>, \$data, </woo>;
   }
 
+  sub HTML_comment {
+    use HTML::Tags;
+    <!-- this is a comment -->;
+  }
+
   sub PI {
     use XML::Tags;
     <?xml version="1.0" encoding="UTF-8"?>;
@@ -49,7 +62,7 @@ use Test::More qw(no_plan);
   }
 
   sub globbery {
-    <t/globbery/*>;
+    <t/globbery/o* t/globbery/t*>;
   }
 }
 
@@ -74,6 +87,19 @@ is(
 );
 
 is(
+  join('', HTML::Tags::to_html_string Foo::xquux),
+  '<link href="#self" rel="me" />' .
+  '<table><tr><td>x<sub>1</sub></td></tr></table>',
+  'Conflicting HTML tags ok'
+);
+
+is(
+  join('', XML::Tags::to_xml_string Foo::HTML_comment),
+  '<!-- this is a comment -->',
+  'HTML comment ok'
+);
+
+is(
   join('', XML::Tags::to_xml_string Foo::fleem),
   '<woo ent="one&amp;two&lt;three&gt;&quot;four">',
   'Escaping ok'
@@ -99,6 +125,6 @@ is(
 
 is(
   join(', ', Foo::globbery),
-  't/globbery/one, t/globbery/two',
+  $globbery,
   'real glob re-installed ok'
 );