We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9980137 commit 52fb10bCopy full SHA for 52fb10b
src/test/scala/scala/xml/XMLTest.scala
@@ -836,4 +836,16 @@ expected closing tag of foo
836
assertEquals("""<x:foo xmlns:x="gaga"/>""", pp.format(x))
837
}
838
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
+
851
0 commit comments