summaryrefslogtreecommitdiff
path: root/test/junit
diff options
context:
space:
mode:
authorSom Snytt <som.snytt@gmail.com>2016-06-16 00:43:51 -0700
committerSom Snytt <som.snytt@gmail.com>2016-06-16 00:43:51 -0700
commit8eaa53d57c8d3346e03ccde7b7d4c4c8103d9253 (patch)
tree7810a5f3c918471e071a7130e6d9323a5f03d8fe /test/junit
parent79e7334f93da4717ee846f74e48ab53533e6756d (diff)
downloadscala-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')
-rw-r--r--test/junit/scala/reflect/internal/PrintersTest.scala8
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")