summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-08-08 06:55:12 +0000
committerPaul Phillips <paulp@improving.org>2012-03-14 20:05:27 -0700
commit125b5037c866fd6db771cf78de44479588e8f118 (patch)
tree008b97d7b144a7361fd96e0bc568b60beac82c2b /test
parent8e9e2e30db0cb36029443a49179dfab4eb08c43a (diff)
downloadscala-125b5037c866fd6db771cf78de44479588e8f118.tar.gz
scala-125b5037c866fd6db771cf78de44479588e8f118.tar.bz2
scala-125b5037c866fd6db771cf78de44479588e8f118.zip
Fix for a bug in CharArrayReader which made tri...
Fix for a bug in CharArrayReader which made triple quoted strings fail to parse sometimes. Note: when the temptation strikes to adjust for special cases by letting the regular case happen and subsequently attempting to fix the ball of mutation by selectively applying what seems like the inverse operation, please consider the possibility that this is not the optimal approach. Closes SI-4785, no review.
Diffstat (limited to 'test')
-rw-r--r--test/files/run/triple-quoted-expr.check5
-rw-r--r--test/files/run/triple-quoted-expr.scala26
2 files changed, 31 insertions, 0 deletions
diff --git a/test/files/run/triple-quoted-expr.check b/test/files/run/triple-quoted-expr.check
new file mode 100644
index 0000000000..4e59695f36
--- /dev/null
+++ b/test/files/run/triple-quoted-expr.check
@@ -0,0 +1,5 @@
+
+hi
+hi
+
+hi
diff --git a/test/files/run/triple-quoted-expr.scala b/test/files/run/triple-quoted-expr.scala
new file mode 100644
index 0000000000..6d91ac5888
--- /dev/null
+++ b/test/files/run/triple-quoted-expr.scala
@@ -0,0 +1,26 @@
+class A {
+ def f1 = {
+ val x = 5
+
+"""
+hi"""
+ }
+ def f2 = {
+ val x = 5
+
+ """hi"""
+ }
+ def f3 = {
+ val x = 5
+
+ "\nhi"
+ }
+}
+
+object Test {
+ def main(args: Array[String]): Unit = {
+ val x = new A
+ import x._
+ List(f1, f2, f3) foreach println
+ }
+}