Description: use Test::XML for comparing XML strings
Due to the hash randomisation feature in perl 5.17.5+, comparing the string
representation of complex XML structures is very fragile, as the order of
attribute serialization is no longer deterministic.
Test::XML's is_xml() function solves this, by allowing order differences.
Author: Damyan Ivanov <dmn@debian.org>
Forwarded: yes
Bug:
https://rt.cpan.org/Public/Bug/Display.html?id=81571
Bug-Debian:
http://bugs.debian.org/710981
--- a/t/11WSDL01basic.t
+++ b/t/11WSDL01basic.t
@@ -6,6 +6,7 @@ use lib length $0 > 10 ? substr $0, 0, l
use strict;
use warnings;
use XML::XPath;
+use Test::XML;
eval {
new Pod::WSDL(source => 'bla');
@@ -90,7 +91,7 @@ my $outputtest;
my $tmp = $p->WSDL;
$tmp =~ s/<!-- WSDL.*?-->\n//;
-ok($outputtest eq $tmp, "Pretty works.");
+is_xml($outputtest, $tmp, "Pretty works.");
$outputtestFile = $0;
$outputtestFile =~ s![^/]+$!outputtest002.xml!;
@@ -108,8 +109,8 @@ my $outputtest2;
$tmp = $p->WSDL(pretty => 0);
$tmp =~ s/<!-- WSDL.*?-->\n//;
#print "--->$tmp<---\n";
-ok($outputtest2 eq $tmp, "Switch pretty off works.");
+is_xml($outputtest2, $tmp, "Switch pretty off works.");
$tmp = $p->WSDL(pretty => 1);
$tmp =~ s/<!-- WSDL.*?-->\n//;
-ok($outputtest eq $tmp, "Switch pretty on works.");
+is_xml($outputtest, $tmp, "Switch pretty on works.");
--- a/META.yml
+++ b/META.yml
@@ -17,6 +17,7 @@ requires:
IO::Scalar: 2.110
Pod::Text: 2.21
Test::More: 0.47
+ Test::XML: 0
XML::Writer: 0.531
XML::XPath: 1.13
resources:
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -24,6 +24,7 @@ my %WriteMakefileArgs = (
'IO::Scalar' => '2.110',
'Pod::Text' => '2.21',
'Test::More' => '0.47',
+ 'Test::XML' => 0,
'XML::Writer' => '0.531',
'XML::XPath' => '1.13'
},