Skip to content

Commit 52fb10b

Browse files
committed
Unit test for scala#46
1 parent 9980137 commit 52fb10b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

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

+12
Original file line numberDiff line numberDiff line change
@@ -836,4 +836,16 @@ expected closing tag of foo
836836
assertEquals("""<x:foo xmlns:x="gaga"/>""", pp.format(x))
837837
}
838838

839+
@UnitTest
840+
def issue46: Unit = {
841+
// val x = <node/>
842+
val x = <node></node>
843+
// val x = Elem(null, "node", e, sc)
844+
val pp = new xml.PrettyPrinter(80, 2)
845+
// This assertion passed
846+
assertEquals("<node></node>", x.toString)
847+
// This was the bug, producing <node></node>
848+
assertEquals("<node/>", pp.format(x.copy(minimizeEmpty = true)))
849+
}
850+
839851
}

0 commit comments

Comments
 (0)