diff options
author | Paul Phillips <paulp@improving.org> | 2010-02-26 22:24:46 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2010-02-26 22:24:46 +0000 |
commit | 64fd0c1346dcd43cb814e4f99638321c159108fd (patch) | |
tree | a9cc92f5756442698813bc4d97bdf191b85b0680 /test/files/jvm/xmlstuff.scala | |
parent | 462e27a358fc466d51aaeec28c994c6667d320eb (diff) | |
download | scala-64fd0c1346dcd43cb814e4f99638321c159108fd.tar.gz scala-64fd0c1346dcd43cb814e4f99638321c159108fd.tar.bz2 scala-64fd0c1346dcd43cb814e4f99638321c159108fd.zip |
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.
Diffstat (limited to 'test/files/jvm/xmlstuff.scala')
-rw-r--r-- | test/files/jvm/xmlstuff.scala | 8 |
1 files changed, 4 insertions, 4 deletions
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 = <bks> @@ -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 <result> { 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 <result> { t.child } { r \ "phone" } |