From a6ce8e3a423b7118eab48b2c94e159e637ace13a Mon Sep 17 00:00:00 2001 From: Som Snytt Date: Thu, 16 Jun 2016 00:43:51 -0700 Subject: Avoid triple-quoting triple quotes The boolean test for triples was inadvertently flipped. Adds test for pretty printed multiline strings --- test/junit/scala/reflect/internal/PrintersTest.scala | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test') diff --git a/test/junit/scala/reflect/internal/PrintersTest.scala b/test/junit/scala/reflect/internal/PrintersTest.scala index 9bfe6eecb8..cacff6a012 100644 --- a/test/junit/scala/reflect/internal/PrintersTest.scala +++ b/test/junit/scala/reflect/internal/PrintersTest.scala @@ -86,6 +86,14 @@ trait BasePrintTests { @Test def testConstantLong = assertTreeCode(Literal(Constant(42l)))("42L") + @Test def testConstantMultiline = assertTreeCode(Literal(Constant("hello\nworld")))("\"\"\"hello\nworld\"\"\"") + + val sq = "\"" + val teq = "\\\"" * 3 + val tq = "\"" * 3 + + @Test def testConstantEmbeddedTriple = assertTreeCode(Literal(Constant(s"${tq}hello${tq}\nworld")))(s"${sq}${teq}hello${teq}\\nworld${sq}") + @Test def testOpExpr = assertPrintedCode("(5).+(4)", checkTypedTree = false) @Test def testName1 = assertPrintedCode("class test") -- cgit v1.2.3