diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/junit/scala/reflect/internal/PrintersTest.scala | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/test/junit/scala/reflect/internal/PrintersTest.scala b/test/junit/scala/reflect/internal/PrintersTest.scala index 916f21adc8..38fe205af7 100644 --- a/test/junit/scala/reflect/internal/PrintersTest.scala +++ b/test/junit/scala/reflect/internal/PrintersTest.scala @@ -79,13 +79,17 @@ class BasePrintTest { @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 + val teq = "\"\"\\\"" + + @Test def testConstantMultiline = assertTreeCode(Literal(Constant("hello\nworld")))(s"${tq}hello\nworld${tq}") + + @Test def testConstantFormfeed = assertTreeCode(Literal(Constant("hello\fworld")))(s"${sq}hello\\fworld${sq}") + + @Test def testConstantControl = assertTreeCode(Literal(Constant("hello\u0003world")))(s"${sq}hello\\03world${sq}") - @Test def testConstantEmbeddedTriple = assertTreeCode(Literal(Constant(s"${tq}hello${tq}\nworld")))(s"${sq}${teq}hello${teq}\\nworld${sq}") + @Test def testConstantEmbeddedTriple = assertTreeCode(Literal(Constant(s"${tq}hello${tq}\nworld")))(s"${tq}${teq}hello${teq}\nworld${tq}") @Test def testOpExpr = assertPrintedCode("(5).+(4)", checkTypedTree = false) |