From 0eac3cb85dd4720b015a0d060691f68b63032b85 Mon Sep 17 00:00:00 2001 From: Som Snytt Date: Thu, 16 Jun 2016 10:15:56 -0700 Subject: Constant print control in unicode Since octal escape is deprecated, use unicode escape for string representation of constants. --- test/junit/scala/reflect/internal/PrintersTest.scala | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'test/junit') diff --git a/test/junit/scala/reflect/internal/PrintersTest.scala b/test/junit/scala/reflect/internal/PrintersTest.scala index 38fe205af7..d581ca8cf4 100644 --- a/test/junit/scala/reflect/internal/PrintersTest.scala +++ b/test/junit/scala/reflect/internal/PrintersTest.scala @@ -87,7 +87,11 @@ class BasePrintTest { @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 testConstantControl = assertTreeCode(Literal(Constant("hello\u0003world")))(s"${sq}hello\\u0003world${sq}") + + @Test def testConstantFormfeedChar = assertTreeCode(Literal(Constant('\f')))("'\\f'") + + @Test def testConstantControlChar = assertTreeCode(Literal(Constant(3.toChar)))("'\\u0003'") @Test def testConstantEmbeddedTriple = assertTreeCode(Literal(Constant(s"${tq}hello${tq}\nworld")))(s"${tq}${teq}hello${teq}\nworld${tq}") -- cgit v1.2.3