Skip to content

Commit

Permalink
Unit tests for scala#76 PrettyPrinter removes newlines
Browse files Browse the repository at this point in the history
  • Loading branch information
ashawley committed Sep 17, 2015
1 parent 3161a38 commit bce3b4b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/test/scala/scala/xml/XMLTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,20 @@ expected closing tag of foo
assertEquals("""<x:foo xmlns:x="gaga"/>""", pp.format(x))
}

@UnitTest
def issue76: Unit = {
val pp = new PrettyPrinter(9999,2)
val x = <foo>{"hi\nthere"}</foo>
assertEquals("<foo>hi\nthere</foo>", x.toString)
assertEquals("<foo>hi there</foo>", pp.format(x))
val y = PCData("hi\nthere")
assertEquals("<![CDATA[hi\nthere]]>", y.toString)
assertEquals("<![CDATA[hi\nthere]]>", pp.format(y))
val z = <foo>{PCData("hi\nthere")}</foo>
assertEquals("<foo><![CDATA[hi\nthere]]></foo>", z.toString)
assertEquals("<foo><![CDATA[hi\nthere]]></foo>", pp.format(z))
}

@UnitTest
def nodeSeqNs: Unit = {
val x = {
Expand Down

0 comments on commit bce3b4b

Please sign in to comment.