Skip to content

Commit 232439e

Browse files
committed
Unit test for #28 PrettyPrinter adds empty attribute with xmlns
* src/test/scala/scala/xml/XMLTest.scala (issue28): New unit test
1 parent 57b6e25 commit 232439e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

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

+10
Original file line numberDiff line numberDiff line change
@@ -824,4 +824,14 @@ expected closing tag of foo
824824
}
825825
}
826826

827+
@UnitTest
828+
def issue28: Unit = {
829+
val x = <x:foo xmlns:x="gaga"/>
830+
// val ns = new NamespaceBinding("x", "gaga", sc)
831+
// val x = Elem("x", "foo", e, ns)
832+
val pp = new xml.PrettyPrinter(80, 2)
833+
assertEquals("""<x:foo xmlns:x="gaga"/>""", x.toString)
834+
assertEquals("""<x:foo xmlns:x="gaga"/>""", pp.format(x))
835+
}
836+
827837
}

0 commit comments

Comments
 (0)