Skip to content

Commit cfe3ee8

Browse files
committed
Improve junit tests to use assertEquals
Using assertTrue and == won't show expected versus result.
1 parent 1715b8a commit cfe3ee8

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

jvm/src/test/scala/scala/xml/XMLTest.scala

+8-8
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ class XMLTestJVM {
4040
override def text = ""
4141
}
4242

43-
assertTrue(c == parsedxml11)
44-
assertTrue(parsedxml1 == parsedxml11)
43+
assertEquals(c, parsedxml11)
44+
assertEquals(parsedxml1, parsedxml11)
4545
assertTrue(List(parsedxml1) sameElements List(parsedxml11))
4646
assertTrue(Array(parsedxml1).toList sameElements List(parsedxml11))
4747

@@ -50,10 +50,10 @@ class XMLTestJVM {
5050
val i = new InputSource(new StringReader(x2))
5151
val x2p = scala.xml.XML.load(i)
5252

53-
assertTrue(x2p == Elem(null, "book", e, sc,
53+
assertEquals(Elem(null, "book", e, sc,
5454
Elem(null, "author", e, sc, Text("Peter Buneman")),
5555
Elem(null, "author", e, sc, Text("Dan Suciu")),
56-
Elem(null, "title", e, sc, Text("Data on ze web"))))
56+
Elem(null, "title", e, sc, Text("Data on ze web"))), x2p)
5757

5858
}
5959

@@ -454,16 +454,16 @@ class XMLTestJVM {
454454
@UnitTest
455455
def t6939 = {
456456
val foo = <x:foo xmlns:x="http://foo.com/"><x:bar xmlns:x="http://bar.com/"><x:baz/></x:bar></x:foo>
457-
assertTrue(foo.child.head.scope.toString == """ xmlns:x="http://bar.com/"""")
457+
assertEquals(foo.child.head.scope.toString, """ xmlns:x="http://bar.com/"""")
458458

459459
val fooDefault = <foo xmlns="http://foo.com/"><bar xmlns="http://bar.com/"><baz/></bar></foo>
460-
assertTrue(fooDefault.child.head.scope.toString == """ xmlns="http://bar.com/"""")
460+
assertEquals(fooDefault.child.head.scope.toString, """ xmlns="http://bar.com/"""")
461461

462462
val foo2 = scala.xml.XML.loadString("""<x:foo xmlns:x="http://foo.com/"><x:bar xmlns:x="http://bar.com/"><x:baz/></x:bar></x:foo>""")
463-
assertTrue(foo2.child.head.scope.toString == """ xmlns:x="http://bar.com/"""")
463+
assertEquals(foo2.child.head.scope.toString, """ xmlns:x="http://bar.com/"""")
464464

465465
val foo2Default = scala.xml.XML.loadString("""<foo xmlns="http://foo.com/"><bar xmlns="http://bar.com/"><baz/></bar></foo>""")
466-
assertTrue(foo2Default.child.head.scope.toString == """ xmlns="http://bar.com/"""")
466+
assertEquals(foo2Default.child.head.scope.toString, """ xmlns="http://bar.com/"""")
467467
}
468468

469469
@UnitTest

0 commit comments

Comments
 (0)