From 64fd0c1346dcd43cb814e4f99638321c159108fd Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Fri, 26 Feb 2010 22:24:46 +0000 Subject: Quite a lot more work on XML equality than I ca... Quite a lot more work on XML equality than I can properly justify spending time on, but you know how it is once you get started on something. This commit will likely break some code out there in the world but this is impossible to avoid if we are to achieve sane equality in trunk. For anyone who was relying upon the 2.7 equality behavior for scala.xml.* classes, using "xml_==" instead of "==" for comparisons will restore the old behavior. The standard == on xml elements now attempts to behave in such a way that symmetry and hashCode contracts will be preserved. It's probably not 100% there yet, but I can tell you this: it is closer today than it was yesterday. Review by community. --- test/files/jvm/xmlstuff.scala | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test/files/jvm/xmlstuff.scala') diff --git a/test/files/jvm/xmlstuff.scala b/test/files/jvm/xmlstuff.scala index 46faf283dc..6e711a0f86 100644 --- a/test/files/jvm/xmlstuff.scala +++ b/test/files/jvm/xmlstuff.scala @@ -64,9 +64,9 @@ passed ok Text(x.attributes("value").toString + y.attributes("bazValue").toString+ "!") }; val pelems_2 = new NodeSeq { val theSeq = List(Text("38!"),Text("58!")) }; - assertSameElements(pelems_1, pelems_2) + assertSameElementsXML(pelems_1, pelems_2) - assertEquals(p \\ "@bazValue", Text("8")) + assertEqualsXML(p \\ "@bazValue", Text("8")) val books = @@ -97,7 +97,7 @@ passed ok println( new scala.xml.PrettyPrinter(80, 5).formatNodes ( for (t <- books \\ "title"; r <- reviews \\ "entry" - if r \ "title" == t) yield + if (r \ "title") xml_== t) yield { t } { r \ "remarks" } @@ -139,7 +139,7 @@ val addrBook = println( new scala.xml.PrettyPrinter(80, 5).formatNodes ( for (t <- addrBook \\ "entry"; r <- phoneBook \\ "entry" - if t \ "name" == r \ "name") yield + if (t \ "name") xml_== (r \ "name")) yield { t.child } { r \ "phone" } -- cgit v1.2.3