diff options
author | Som Snytt <som.snytt@gmail.com> | 2016-06-16 00:43:51 -0700 |
---|---|---|
committer | Som Snytt <som.snytt@gmail.com> | 2016-06-16 00:43:51 -0700 |
commit | 8eaa53d57c8d3346e03ccde7b7d4c4c8103d9253 (patch) | |
tree | 7810a5f3c918471e071a7130e6d9323a5f03d8fe /test/junit/scala | |
parent | 79e7334f93da4717ee846f74e48ab53533e6756d (diff) | |
download | scala-8eaa53d57c8d3346e03ccde7b7d4c4c8103d9253.tar.gz scala-8eaa53d57c8d3346e03ccde7b7d4c4c8103d9253.tar.bz2 scala-8eaa53d57c8d3346e03ccde7b7d4c4c8103d9253.zip |
Avoid triple-quoting triple quotes
The boolean test for triples was inadvertently flipped.
Adds test for pretty printed multiline strings
Diffstat (limited to 'test/junit/scala')
-rw-r--r-- | test/junit/scala/reflect/internal/PrintersTest.scala | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/junit/scala/reflect/internal/PrintersTest.scala b/test/junit/scala/reflect/internal/PrintersTest.scala index 2305e7ea50..916f21adc8 100644 --- a/test/junit/scala/reflect/internal/PrintersTest.scala +++ b/test/junit/scala/reflect/internal/PrintersTest.scala @@ -79,6 +79,14 @@ 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 + + @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") |