From bce3b4ba84dd2abbff56ee31cc349c52b6c787c4 Mon Sep 17 00:00:00 2001 From: "Aaron S. Hawley" Date: Thu, 17 Sep 2015 14:00:51 -0400 Subject: [PATCH] Unit tests for #76 PrettyPrinter removes newlines --- src/test/scala/scala/xml/XMLTest.scala | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/test/scala/scala/xml/XMLTest.scala b/src/test/scala/scala/xml/XMLTest.scala index 6ab741390..d925c6d15 100644 --- a/src/test/scala/scala/xml/XMLTest.scala +++ b/src/test/scala/scala/xml/XMLTest.scala @@ -838,6 +838,20 @@ expected closing tag of foo assertEquals("""""", pp.format(x)) } + @UnitTest + def issue76: Unit = { + val pp = new PrettyPrinter(9999,2) + val x = {"hi\nthere"} + assertEquals("hi\nthere", x.toString) + assertEquals("hi there", pp.format(x)) + val y = PCData("hi\nthere") + assertEquals("", y.toString) + assertEquals("", pp.format(y)) + val z = {PCData("hi\nthere")} + assertEquals("", z.toString) + assertEquals("", pp.format(z)) + } + @UnitTest def nodeSeqNs: Unit = { val x = {