Shlomi Fish avatar Shlomi Fish committed 5f5504f

Create my_is_xml().

With some common options.

Comments (0)

Files changed (1)

XML-GrammarBase/t/xslt.t

 
 use File::Temp qw(tempfile);
 
+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,
+    );
+}
+
 sub _utf8_slurp
 {
     my $filename = shift;
         my $xml_source = _utf8_slurp($output_fn);
 
         # TEST:$c++;
-        is_xml_ordered(
+        my_is_xml(
             [ string => $final_source, ],
             [ string => $xml_source, ],
-            {},
             "'$input_fn' generated good output on source/input_filename - output - string"
         );
     }
         my $xml_source = _utf8_slurp($output_fn);
 
         # TEST:$c++;
-        is_xml_ordered(
+        my_is_xml(
             [ string => $final_source, ],
             [ string => $xml_source, ],
-            {},
             "'$input_fn' generated good output on source/string_ref - output - string"
         );
     }
         my $xml_source = _utf8_slurp($output_fn);
 
         # TEST:$c++;
-        is_xml_ordered(
+        my_is_xml(
             [ string => $final_dom->toString(), ],
             [ string => $xml_source, ],
-            {},
             "'$input_fn' generated good output on source/string_ref - output - dom"
         );
     }
         my $final_source = _utf8_slurp($filename);
 
         # TEST:$c++;
-        is_xml_ordered(
+        my_is_xml(
             [ string => $final_source, ],
             [ string => $xml_source, ],
-            {},
             "'$input_fn' generated good output on source/string_ref - output/file"
         );
     }
         my $final_source = _utf8_slurp($filename);
 
         # TEST:$c++;
-        is_xml_ordered(
+        my_is_xml(
             [ string => $final_source, ],
             [ string => $xml_source, ],
-            {},
             "'$input_fn' generated good output on source/string_ref - output/fh"
         );
     }
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.