From e0e7df1b7e9fef64372560cf8e149a58ee3ec00f Mon Sep 17 00:00:00 2001 From: "Aaron S. Hawley" Date: Wed, 3 May 2017 00:29:42 -0400 Subject: [PATCH] Improve junit tests to use assertEquals Using assertTrue and == won't show expected versus result. --- jvm/src/test/scala/scala/xml/XMLTest.scala | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/jvm/src/test/scala/scala/xml/XMLTest.scala b/jvm/src/test/scala/scala/xml/XMLTest.scala index 37d45bccc..11387171b 100644 --- a/jvm/src/test/scala/scala/xml/XMLTest.scala +++ b/jvm/src/test/scala/scala/xml/XMLTest.scala @@ -41,8 +41,8 @@ class XMLTestJVM { override def text = "" } - assertTrue(c == parsedxml11) - assertTrue(parsedxml1 == parsedxml11) + assertEquals(c, parsedxml11) + assertEquals(parsedxml1, parsedxml11) assertTrue(List(parsedxml1) sameElements List(parsedxml11)) assertTrue(Array(parsedxml1).toList sameElements List(parsedxml11)) @@ -51,10 +51,10 @@ class XMLTestJVM { val i = new InputSource(new StringReader(x2)) val x2p = scala.xml.XML.load(i) - assertTrue(x2p == Elem(null, "book", e, sc, + assertEquals(Elem(null, "book", e, sc, Elem(null, "author", e, sc, Text("Peter Buneman")), Elem(null, "author", e, sc, Text("Dan Suciu")), - Elem(null, "title", e, sc, Text("Data on ze web")))) + Elem(null, "title", e, sc, Text("Data on ze web"))), x2p) } @@ -455,16 +455,16 @@ class XMLTestJVM { @UnitTest def t6939 = { val foo = - assertTrue(foo.child.head.scope.toString == """ xmlns:x="http://bar.com/"""") + assertEquals(foo.child.head.scope.toString, """ xmlns:x="http://bar.com/"""") val fooDefault = - assertTrue(fooDefault.child.head.scope.toString == """ xmlns="http://bar.com/"""") + assertEquals(fooDefault.child.head.scope.toString, """ xmlns="http://bar.com/"""") val foo2 = scala.xml.XML.loadString("""""") - assertTrue(foo2.child.head.scope.toString == """ xmlns:x="http://bar.com/"""") + assertEquals(foo2.child.head.scope.toString, """ xmlns:x="http://bar.com/"""") val foo2Default = scala.xml.XML.loadString("""""") - assertTrue(foo2Default.child.head.scope.toString == """ xmlns="http://bar.com/"""") + assertEquals(foo2Default.child.head.scope.toString, """ xmlns="http://bar.com/"""") } @UnitTest