summaryrefslogtreecommitdiff
path: root/test/files/run/interpolationMultiline2.scala
diff options
context:
space:
mode:
authorEugene Burmako <xeno.by@gmail.com>2012-02-15 16:07:27 +0100
committerEugene Burmako <xeno.by@gmail.com>2012-02-15 16:52:17 +0100
commit9e224c4f66c232cce8bbfa7e9ca25a84222baffd (patch)
tree192dce3b5020423c84209ff3ca9078e9f01b7a07 /test/files/run/interpolationMultiline2.scala
parenta2ce52f838d7ae4a1af93e5149e38ef87e9cd06d (diff)
downloadscala-9e224c4f66c232cce8bbfa7e9ca25a84222baffd.tar.gz
scala-9e224c4f66c232cce8bbfa7e9ca25a84222baffd.tar.bz2
scala-9e224c4f66c232cce8bbfa7e9ca25a84222baffd.zip
Makes multiline interpolation work finely
Diffstat (limited to 'test/files/run/interpolationMultiline2.scala')
-rw-r--r--test/files/run/interpolationMultiline2.scala21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/files/run/interpolationMultiline2.scala b/test/files/run/interpolationMultiline2.scala
new file mode 100644
index 0000000000..f6a682c3ce
--- /dev/null
+++ b/test/files/run/interpolationMultiline2.scala
@@ -0,0 +1,21 @@
+object Test extends App {
+
+ def test1(n: Int) = {
+ val old = "old"
+ try { println(s"""Bob is ${s"$n"} years ${s"$old"}!""") } catch { case ex => println(ex) }
+ try { println(s"""Bob is ${f"$n"} years ${s"$old"}!""") } catch { case ex => println(ex) }
+ try { println(f"""Bob is ${s"$n"} years ${s"$old"}!""") } catch { case ex => println(ex) }
+ try { println(f"""Bob is ${f"$n"} years ${s"$old"}!""") } catch { case ex => println(ex) }
+ try { println(f"""Bob is ${f"$n%2d"} years ${s"$old"}!""") } catch { case ex => println(ex) }
+ try { println(f"""Bob is ${s"$n%2d"} years ${s"$old"}!""") } catch { case ex => println(ex) }
+ try { println(s"""Bob is ${f"$n%2d"} years ${s"$old"}!""") } catch { case ex => println(ex) }
+ try { println(s"""Bob is ${s"$n%2d"} years ${s"$old"}!""") } catch { case ex => println(ex) }
+ }
+
+ test1(1)
+ println("===============")
+ test1(12)
+ println("===============")
+ test1(123)
+
+}