summaryrefslogtreecommitdiff
path: root/test/files/run/t6559.scala
diff options
context:
space:
mode:
authorJosh Suereth <joshua.suereth@gmail.com>2012-10-24 10:59:50 -0400
committerJosh Suereth <joshua.suereth@gmail.com>2012-10-30 10:44:08 -0400
commit492cbe5eec2df5d3e3a4310cf0fda5b86855299f (patch)
tree7bf9315fefbae38be990cd788fc054c2223b3383 /test/files/run/t6559.scala
parent34d021ad2021d3dbedc8b6fe20f7f0f6d1569757 (diff)
downloadscala-492cbe5eec2df5d3e3a4310cf0fda5b86855299f.tar.gz
scala-492cbe5eec2df5d3e3a4310cf0fda5b86855299f.tar.bz2
scala-492cbe5eec2df5d3e3a4310cf0fda5b86855299f.zip
Fixes SI-6559 - StringContext not using passed in escape function.
As reported by Curtis Stanford, with indication of what to fix. standardInterpolator was not correctly calling the passed in process function, so raw strings were not really raw.
Diffstat (limited to 'test/files/run/t6559.scala')
-rw-r--r--test/files/run/t6559.scala17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/files/run/t6559.scala b/test/files/run/t6559.scala
new file mode 100644
index 0000000000..5c671f7275
--- /dev/null
+++ b/test/files/run/t6559.scala
@@ -0,0 +1,17 @@
+
+object Test {
+
+ def main(args: Array[String]) = {
+ val one = "1"
+ val two = "2"
+
+ val raw = raw"\n$one\n$two\n"
+ val escaped = s"\n$one\n$two\n"
+ val buggy = "\\n1\n2\n"
+ val correct = "\\n1\\n2\\n"
+
+ assert(raw != escaped, "Raw strings should not be escaped.")
+ assert(raw != buggy, "Raw strings after variables should not be escaped.")
+ assert(raw == correct, "Raw strings should stay raw.")
+ }
+}