Commits

Shlomi Fish committed 5f5504f

Create my_is_xml().

With some common options.

  • Participants
  • Parent commits 56dc75b

Comments (0)

Files changed (1)

File 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"
         );
     }