From 89bacb9c25a58454ff1878e67f7ea07ffc8c269f Mon Sep 17 00:00:00 2001 From: Dmitry Petrashko Date: Tue, 12 May 2015 18:30:53 +0200 Subject: Run tests as they were in scala. --- tests/pending/run/interpolationMultiline1.scala | 26 +++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 tests/pending/run/interpolationMultiline1.scala (limited to 'tests/pending/run/interpolationMultiline1.scala') diff --git a/tests/pending/run/interpolationMultiline1.scala b/tests/pending/run/interpolationMultiline1.scala new file mode 100644 index 000000000..db634e777 --- /dev/null +++ b/tests/pending/run/interpolationMultiline1.scala @@ -0,0 +1,26 @@ +object Test extends App { + + def test1(n: Int) = { + println(s"""Bob is $n years old""") + println(f"""Bob is $n%2d years old""") + println(s"""Bob will be ${n+1} years old""") + println(f"""Bob will be ${n+1}%2d years old""") + println(s"""$n+1 = ${n+1}""") + println(f"""$n%d+1 = ${n+1}%d""") + } + + def test2(f: Float) = { + println(s"""Best price: $f""") + println(f"""Best price: $f%.2f""") + println(s"""$f% discount included""") + println(f"""$f%3.2f%% discount included""") + } + + test1(1) + test1(12) + test1(123) + + test2(10.0f) + test2(13.345f) + +} -- cgit v1.2.3