Commits

Shlomi Fish committed f03b3ab

Start converting from Test::XML to Test::XML::Ordered.

  • Participants
  • Parent commits fa1126f

Comments (0)

Files changed (3)

File perl/modules/XML-Grammar-Fiction/t/fiction/to-docbook.t

 use strict;
 use warnings;
 
-use Test::More;
+use lib './t/lib';
 
-use Test::XML tests => 33;
+use Test::More tests => 33;
+
+use XmlGrammarTestXML qw(my_is_xml);
 
 use File::Spec;
 
     );
 
     # TEST*$num_texts
-    is_xml ($docbook_text, load_xml("t/fiction/data/docbook/$fn.docbook.xml"),
+    my_is_xml (
+        [ string => $docbook_text, ],
+        [ string => load_xml("t/fiction/data/docbook/$fn.docbook.xml"), ],
         "Output of the DocBook \"$fn\"",
     );
 }

File perl/modules/XML-Grammar-Fiction/t/lib/XmlGrammarTestXML.pm

+package XmlGrammarTestXML;
+
+use strict;
+use warnings;
+
+use parent 'Exporter';
+
+our @EXPORT_OK = (qw(my_is_xml));
+
+use Test::XML::Ordered '0.0.4';
+use Test::XML::Ordered qw(is_xml_ordered);
+
+my @is_xml_common = (validation => 0, load_ext_dtd => 0, no_network => 1);
+
+sub my_is_xml
+{
+    local $Test::Builder::Level = $Test::Builder::Level + 1;
+
+    my ($got, $expected, $blurb) = @_;
+
+    return is_xml_ordered(
+        [ @{$got}, @is_xml_common, ],
+        [ @{$expected}, @is_xml_common, ],
+        {},
+        $blurb,
+    );
+}
+
+1;
+

File perl/modules/XML-Grammar-Fiction/t/screenplay/to-xhtml.t

 
 use Test::More;
 
-use Test::XML tests => 6;
+use lib './t/lib';
+
+use Test::More tests => 6;
 
 use File::Spec;