From: sgunderson@bigfoot.com <> Date: Wed, 6 Sep 2006 14:17:33 +0000 (+0200) Subject: Be yet more flexible about the textual node diffing. X-Git-Url: https://git.sesse.net/?p=xml-template;a=commitdiff_plain;h=1e8e08ddc43951981e751c89f8e0edb3c45de707 Be yet more flexible about the textual node diffing. --- diff --git a/tests/xml-diff.pl b/tests/xml-diff.pl index eba854f..023ce13 100644 --- a/tests/xml-diff.pl +++ b/tests/xml-diff.pl @@ -69,10 +69,13 @@ sub compare { $d1 =~ s/\s+$//; $d2 =~ s/\s+$//; - if ($d1 ne $d2) { - $d1 =~ s/\n/\\n/; - $d2 =~ s/\n/\\n/; + # compress other whitespace + $d1 =~ s/\n/ /g; + $d1 =~ s/ +/ /g; + $d2 =~ s/\n/ /g; + $d2 =~ s/ +/ /g; + if ($d1 ne $d2) { print STDERR "$nsuri1/$lname1 has differing textual content ('$d1' vs. '$d2')\n"; exit(1); }