diff options
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/interpolation.check | 6 | ||||
-rw-r--r-- | test/files/run/interpolation.scala | 6 | ||||
-rw-r--r-- | test/files/run/t5527.check | 86 | ||||
-rw-r--r-- | test/files/run/t5527.scala | 70 |
4 files changed, 162 insertions, 6 deletions
diff --git a/test/files/run/interpolation.check b/test/files/run/interpolation.check index 09579a800a..997abb4497 100644 --- a/test/files/run/interpolation.check +++ b/test/files/run/interpolation.check @@ -24,3 +24,9 @@ Best price: 13.345 Best price: 13.35 13.345% discount included 13.35% discount included + +0 +00 + +0 +00 diff --git a/test/files/run/interpolation.scala b/test/files/run/interpolation.scala index a0a185eaab..f443bd5feb 100644 --- a/test/files/run/interpolation.scala +++ b/test/files/run/interpolation.scala @@ -23,4 +23,10 @@ object Test extends App { test2(10.0f) test2(13.345f) + println(s"") + println(s"${0}") + println(s"${0}${0}") + println(f"") + println(f"${0}") + println(f"${0}${0}") } diff --git a/test/files/run/t5527.check b/test/files/run/t5527.check index bdd5ac8295..4a8a9ce602 100644 --- a/test/files/run/t5527.check +++ b/test/files/run/t5527.check @@ -1,11 +1,12 @@ [[syntax trees at end of parser]]// Scala source: newSource1 package <empty> { - abstract trait Test extends scala.ScalaObject { - def $init$() = { + object UselessComments extends scala.ScalaObject { + def <init>() = { + super.<init>(); () }; - def sth: scala.Unit = { - /** Some comment here */ + var z = 0; + def test1 = { object Maybe extends scala.ScalaObject { def <init>() = { super.<init>(); @@ -15,6 +16,83 @@ package <empty> { def nothing() = () }; () + }; + def test2 = { + var x = 4; + if (true) + { + x = 5; + val y = 6; + () + } + else + () + }; + def test3 = { + if (true) + z = 3 + else + (); + val t = 4; + 0.to(4).foreach(((i) => println(i))) + }; + val test4 = 'a' match { + case ('0'| '1'| '2'| '3'| '4'| '5'| '6'| '7'| '8'| '9') => true + case _ => false + } + }; + /** comments that we should keep */ + object UsefulComments extends scala.ScalaObject { + def <init>() = { + super.<init>(); + () + }; + /** class A */ + class A extends scala.ScalaObject { + def <init>() = { + super.<init>(); + () + }; + /** f */ + def f(i: Int) = i; + /** v */ + val v = 1; + /** u */ + var u = 2 + }; + /** trait B */ + abstract trait B extends scala.ScalaObject { + def $init$() = { + () + }; + /** T */ + type T >: _root_.scala.Nothing <: _root_.scala.Any; + /** f */ + def f(i: Int): scala.Unit; + /** v */ + val v = 1; + /** u */ + var u = 2 + }; + /** object C */ + object C extends scala.ScalaObject { + def <init>() = { + super.<init>(); + () + }; + /** f */ + def f(i: Int) = i; + /** v */ + val v = 1; + /** u */ + var u = 2 + }; + /** class D */ + @new deprecated("use ... instead", "2.10.0") class D extends scala.ScalaObject { + def <init>() = { + super.<init>(); + () + } } } } diff --git a/test/files/run/t5527.scala b/test/files/run/t5527.scala index 8280ee06ba..2449ff60c3 100644 --- a/test/files/run/t5527.scala +++ b/test/files/run/t5527.scala @@ -11,14 +11,80 @@ object Test extends DirectTest { override def code = """ // SI-5527 - trait Test { - def sth { + object UselessComments { + + var z = 0 + + def test1 = { /** Some comment here */ object Maybe { /** Some comment inside */ def nothing() = () } } + + def test2 = { + var x = 4 + if (true) { + /** Testing 123 */ + x = 5 + val y = 6 + } + } + + def test3 = { + if (true) + z = 3 + + /** Calculate this result. */ + val t = 4 + for (i <- 0 to 4) + println(i) + } + + val test4 = ('a') match { + /** Another digit is a giveaway. */ + case '0' | '1' | '2' | '3' | '4' | '5' | '6' | '7' | '8' | '9' => + true + case _ => + false + } + } + + /** comments that we should keep */ + object UsefulComments { + /** class A */ + class A { + /** f */ + def f(i: Int) = i + /** v */ + val v = 1 + /** u */ + var u = 2 + } + /** trait B */ + trait B { + /** T */ + type T + /** f */ + def f(i: Int) + /** v */ + val v = 1 + /** u */ + var u = 2 + } + /** object C */ + object C { + /** f */ + def f(i: Int) = i + /** v */ + val v = 1 + /** u */ + var u = 2 + } + /** class D */ + @deprecated("use ... instead", "2.10.0") + class D } """.trim |