diff options
author | Som Snytt <som.snytt@gmail.com> | 2013-04-27 21:36:53 -0700 |
---|---|---|
committer | Som Snytt <som.snytt@gmail.com> | 2013-05-25 09:51:37 -0700 |
commit | 99b4d95fe6c908ce3170ff4d090420f8e47efa1d (patch) | |
tree | f7819550cc9b9cbce24b98f1c5b085939e37883d /test/files/continuations-run | |
parent | 369f1f27ac6a27918e767e393dc6e22f7424aa38 (diff) | |
download | scala-99b4d95fe6c908ce3170ff4d090420f8e47efa1d.tar.gz scala-99b4d95fe6c908ce3170ff4d090420f8e47efa1d.tar.bz2 scala-99b4d95fe6c908ce3170ff4d090420f8e47efa1d.zip |
SI-7003 Partest redirects stderr to log file
Some scalac output is on stderr, and it's useful to see that
in the log file, especially for debugging.
Adds a line filter for logs, specified as "filter: pattern"
in the test source.
Backslashes are made forward only when detected as paths.
Test alignments:
Deprecations which do not pertain to the system under test
are corrected in the obvious way.
When testing deprecated API, suppress warnings by deprecating
the Test object.
Check files are updated with useful true warnings, instead of
running under -nowarn.
Language feature imports as required, instead of running under -language.
Language feature not required, such as casual use of postfix.
Heed useful warning.
Ignore broken warnings. (Rarely, -nowarn.)
Inliner warnings pop up under -optimise only, so for now, just
filter them out where they occur.
Debug output from the test required an update.
Diffstat (limited to 'test/files/continuations-run')
31 files changed, 85 insertions, 55 deletions
diff --git a/test/files/continuations-run/basics.scala b/test/files/continuations-run/basics.scala index b63710bc64..ed1782d77a 100755 --- a/test/files/continuations-run/basics.scala +++ b/test/files/continuations-run/basics.scala @@ -13,7 +13,7 @@ object Test { 2 * shift((k:Int => Int) => k(k(7))) } - def main(args: Array[String]) = { + def main(args: Array[String]) { println(reset(m0())) println(reset(m1())) diff --git a/test/files/continuations-run/function1.scala b/test/files/continuations-run/function1.scala index fbd413ed9d..ec7ebb66a5 100644 --- a/test/files/continuations-run/function1.scala +++ b/test/files/continuations-run/function1.scala @@ -5,7 +5,7 @@ import scala.util.continuations._ object Test { - def main(args: Array[String]): Any = { + def main(args: Array[String]): Unit = { val f = () => shift { k: (Int=>Int) => k(7) } val g: () => Int @cps[Int] = f @@ -13,4 +13,4 @@ object Test { println(reset(g())) } -}
\ No newline at end of file +} diff --git a/test/files/continuations-run/function4.scala b/test/files/continuations-run/function4.scala index 2ccd0b4ff2..232b1ec3a6 100644 --- a/test/files/continuations-run/function4.scala +++ b/test/files/continuations-run/function4.scala @@ -5,11 +5,11 @@ import scala.util.continuations._ object Test { - def main(args: Array[String]): Any = { + def main(args: Array[String]): Unit = { val g: () => Int @cps[Int] = () => shift { k: (Int=>Int) => k(7) } println(reset(g())) } -}
\ No newline at end of file +} diff --git a/test/files/continuations-run/function5.scala b/test/files/continuations-run/function5.scala index fe528e14e7..17ae08c98e 100644 --- a/test/files/continuations-run/function5.scala +++ b/test/files/continuations-run/function5.scala @@ -5,11 +5,11 @@ import scala.util.continuations._ object Test { - def main(args: Array[String]): Any = { + def main(args: Array[String]): Unit = { val g: () => Int @cps[Int] = () => 7 println(reset(g())) } -}
\ No newline at end of file +} diff --git a/test/files/continuations-run/function6.scala b/test/files/continuations-run/function6.scala index 54a6ffcc93..6b4c5adc41 100644 --- a/test/files/continuations-run/function6.scala +++ b/test/files/continuations-run/function6.scala @@ -5,7 +5,7 @@ import scala.util.continuations._ object Test { - def main(args: Array[String]): Any = { + def main(args: Array[String]): Unit = { val g: PartialFunction[Int, Int @cps[Int]] = { case x => 7 } @@ -13,4 +13,4 @@ object Test { } -}
\ No newline at end of file +} diff --git a/test/files/continuations-run/ifelse0.scala b/test/files/continuations-run/ifelse0.scala index 2facab4b98..2c40f64959 100644 --- a/test/files/continuations-run/ifelse0.scala +++ b/test/files/continuations-run/ifelse0.scala @@ -10,9 +10,9 @@ object Test { else shift { k: (Int=>Int) => k(x) } - def main(args: Array[String]): Any = { + def main(args: Array[String]): Unit = { println(reset(1 + test(7))) println(reset(1 + test(8))) } -}
\ No newline at end of file +} diff --git a/test/files/continuations-run/ifelse1.scala b/test/files/continuations-run/ifelse1.scala index c624b84b75..6f52a8c1e3 100644 --- a/test/files/continuations-run/ifelse1.scala +++ b/test/files/continuations-run/ifelse1.scala @@ -15,11 +15,11 @@ object Test { else shift { k: (Int=>Int) => k(k(k(x))) } - def main(args: Array[String]): Any = { + def main(args: Array[String]): Unit = { println(reset(1 + test1(7))) println(reset(1 + test1(8))) println(reset(1 + test2(7))) println(reset(1 + test2(8))) } -}
\ No newline at end of file +} diff --git a/test/files/continuations-run/ifelse2.scala b/test/files/continuations-run/ifelse2.scala index 506acc4d00..f7f8328703 100644 --- a/test/files/continuations-run/ifelse2.scala +++ b/test/files/continuations-run/ifelse2.scala @@ -8,9 +8,9 @@ object Test { def test(x:Int) = if (x <= 7) shift { k: (Unit=>Unit) => println("abort") } - def main(args: Array[String]): Any = { + def main(args: Array[String]): Unit = { println(reset{ test(7); println("alive") }) println(reset{ test(8); println("alive") }) } -}
\ No newline at end of file +} diff --git a/test/files/continuations-run/ifelse3.scala b/test/files/continuations-run/ifelse3.scala index 54566a421c..7b85770be9 100644 --- a/test/files/continuations-run/ifelse3.scala +++ b/test/files/continuations-run/ifelse3.scala @@ -13,9 +13,9 @@ object Test { x + 1 - def main(args: Array[String]): Any = { + def main(args: Array[String]): Unit = { println(reset(test(7))) println(reset(test(8))) } -}
\ No newline at end of file +} diff --git a/test/files/continuations-run/ifelse4.scala b/test/files/continuations-run/ifelse4.scala index 8360375283..a0dbcafc57 100644 --- a/test/files/continuations-run/ifelse4.scala +++ b/test/files/continuations-run/ifelse4.scala @@ -22,10 +22,10 @@ object Test { if (sh(x1)==45) x1 else sh(x1) } - def main(args: Array[String]): Any = { + def main(args: Array[String]): Unit = { println(reset(1 + testA(7))) println(reset(1 + testB(9))) println(reset(1 + testC(9))) println(reset(1 + testD(7))) } -}
\ No newline at end of file +} diff --git a/test/files/continuations-run/infer1.scala b/test/files/continuations-run/infer1.scala index 10822508e7..1196bd40a8 100644 --- a/test/files/continuations-run/infer1.scala +++ b/test/files/continuations-run/infer1.scala @@ -17,7 +17,7 @@ object Test { def util() = shift { k: (String => String) => "7" } - def main(args: Array[String]): Any = { + def main(args: Array[String]): Unit = { test { shift { k: (Int => String) => 9 } } test { shift { k: (Int => String) => 9 }; 2 } // test { shift { k: (Int => String) => 9 }; util() } <-- doesn't work @@ -30,4 +30,4 @@ object Test { } -}
\ No newline at end of file +} diff --git a/test/files/continuations-run/match0.scala b/test/files/continuations-run/match0.scala index b65d343c07..63b73bf21e 100644 --- a/test/files/continuations-run/match0.scala +++ b/test/files/continuations-run/match0.scala @@ -10,9 +10,9 @@ object Test { case 8 => shift { k: (Int=>Int) => k(x) } } - def main(args: Array[String]): Any = { + def main(args: Array[String]): Unit = { println(reset(1 + test(7))) println(reset(1 + test(8))) } -}
\ No newline at end of file +} diff --git a/test/files/continuations-run/match1.scala b/test/files/continuations-run/match1.scala index 20671f26ba..62d639ee72 100644 --- a/test/files/continuations-run/match1.scala +++ b/test/files/continuations-run/match1.scala @@ -10,9 +10,9 @@ object Test { case _ => x } - def main(args: Array[String]): Any = { + def main(args: Array[String]): Unit = { println(reset(1 + test(7))) println(reset(1 + test(8))) } -}
\ No newline at end of file +} diff --git a/test/files/continuations-run/patvirt.scala b/test/files/continuations-run/patvirt.scala index 5b4d312f20..7d769d46fe 100644 --- a/test/files/continuations-run/patvirt.scala +++ b/test/files/continuations-run/patvirt.scala @@ -25,7 +25,7 @@ object Test { o7.get } - def main(args: Array[String]): Any = { + def main(args: Array[String]): Unit = { println(reset(1 + test(7))) println(reset(1 + test(8))) } diff --git a/test/files/continuations-run/t1820.scala b/test/files/continuations-run/t1820.scala index 893ddab6d1..7de6ccabef 100644 --- a/test/files/continuations-run/t1820.scala +++ b/test/files/continuations-run/t1820.scala @@ -10,5 +10,5 @@ object Test { if (b) shifted } } - def main(args: Array[String]) = test1(true) -}
\ No newline at end of file + def main(args: Array[String]): Unit = test1(true) +} diff --git a/test/files/continuations-run/t1821.scala b/test/files/continuations-run/t1821.scala index 0d5fb553be..55bf7b6f12 100644 --- a/test/files/continuations-run/t1821.scala +++ b/test/files/continuations-run/t1821.scala @@ -11,10 +11,10 @@ object Test { def test3[A](x: A): A @suspendable = x match { case x => x } def test4[A](x: List[A]): A @suspendable = x match { case List(x) => x } - def main(args: Array[String]) = { + def main(args: Array[String]) { println(reset(test1())) println(reset(test2(List(())))) println(reset(test3())) println(reset(test4(List(())))) } -}
\ No newline at end of file +} diff --git a/test/files/continuations-run/t3199b.scala b/test/files/continuations-run/t3199b.scala index 2122c963ac..fe1ecafe72 100644 --- a/test/files/continuations-run/t3199b.scala +++ b/test/files/continuations-run/t3199b.scala @@ -4,8 +4,8 @@ object Test { java.util.Arrays.asList(Array(1,2,3):_*) } - def main(args: Array[String]) = { + def main(args: Array[String]) { println(test()) } -}
\ No newline at end of file +} diff --git a/test/files/continuations-run/t3223.scala b/test/files/continuations-run/t3223.scala index efed1ff581..fda61f41ea 100644 --- a/test/files/continuations-run/t3223.scala +++ b/test/files/continuations-run/t3223.scala @@ -6,7 +6,7 @@ object Test { throw new Exception shiftUnit0[Int,Int](7) } catch { - case ex => + case ex: Throwable => val g = (a:Int)=>a 9 } @@ -16,4 +16,4 @@ object Test { println(reset(foo(0))) } -}
\ No newline at end of file +} diff --git a/test/files/continuations-run/t3225.scala b/test/files/continuations-run/t3225.scala index 5b6259c43f..bc6d635c88 100644 --- a/test/files/continuations-run/t3225.scala +++ b/test/files/continuations-run/t3225.scala @@ -48,7 +48,7 @@ object Test { // TODO: check whether this also applies to a::shift { k => ... } - def main(args: Array[String]) = { + def main(args: Array[String]) { testMono() testPoly() } diff --git a/test/files/continuations-run/t5314.check b/test/files/continuations-run/t5314.check index 4b35d8e6d0..61f5b25dc7 100644 --- a/test/files/continuations-run/t5314.check +++ b/test/files/continuations-run/t5314.check @@ -1,3 +1,9 @@ +t5314.scala:34: warning: expression 7 is cps-transformed unexpectedly + def bar3(x:Int): Int @cps[Int] = { foo2(x); if (x == 7) return 7 else return foo2(x) } + ^ +t5314.scala:35: warning: expression 7 is cps-transformed unexpectedly + def bar4(x:Int): Int @cps[Int] = { foo2(x); if (x == 7) return 7 else foo2(x) } + ^ 7 7 7 diff --git a/test/files/continuations-run/t5472.check b/test/files/continuations-run/t5472.check index d42e80c18e..3192c746eb 100644 --- a/test/files/continuations-run/t5472.check +++ b/test/files/continuations-run/t5472.check @@ -1 +1,15 @@ +t5472.scala:12: warning: expression case4(){ + if (x1.ne(null)) + matchEnd3(true) + else + case5() +} is cps-transformed unexpectedly + (location, accessors) <- new ContinuationizedParallelIterable(map) + ^ +t5472.scala:12: warning: expression matchEnd3(x: Int){ + x +} is cps-transformed unexpectedly + (location, accessors) <- new ContinuationizedParallelIterable(map) + ^ +warning: there were 1 deprecation warning(s); re-run with -deprecation for details List(23, 23) diff --git a/test/files/continuations-run/t5472.scala b/test/files/continuations-run/t5472.scala index 3e3c76b32a..060d267544 100644 --- a/test/files/continuations-run/t5472.scala +++ b/test/files/continuations-run/t5472.scala @@ -2,6 +2,7 @@ import scala.annotation._ import scala.util.continuations._ import java.util.concurrent.atomic._ +@deprecated("Suppress warnings", since="2.11") object Test { def main(args: Array[String]) { val map = Map("foo" -> 1, "bar" -> 2) @@ -15,7 +16,6 @@ object Test { println(mapped.toList) } } -} final class ContinuationizedParallelIterable[+A](protected val underline: Iterable[A]) { def toList = underline.toList.sortBy(_.toString) @@ -76,7 +76,7 @@ final class ContinuationizedParallelIterable[+A](protected val underline: Iterab new AtomicInteger(underline.size) with ((ContinuationizedParallelIterable[B] => Unit) => Unit) { override final def apply(continue: ContinuationizedParallelIterable[B] => Unit) { val results = new Array[B](super.get) - for ((element, i) <- underline.view zipWithIndex) { + for ((element, i) <- underline.view.zipWithIndex) { reset { val result = f(element) results(i) = result @@ -88,3 +88,4 @@ final class ContinuationizedParallelIterable[+A](protected val underline: Iterab } }) } +} diff --git a/test/files/continuations-run/t5506.scala b/test/files/continuations-run/t5506.scala index 2b5c1118f7..4b3703c725 100644 --- a/test/files/continuations-run/t5506.scala +++ b/test/files/continuations-run/t5506.scala @@ -42,7 +42,7 @@ z } -def main(args: Array[String]) = { +def main(args: Array[String]) { reset { println(fp10) println(fp11) diff --git a/test/files/continuations-run/t5538.check b/test/files/continuations-run/t5538.check index 457721d5e0..d9d873663d 100644 --- a/test/files/continuations-run/t5538.check +++ b/test/files/continuations-run/t5538.check @@ -1 +1,2 @@ +warning: there were 1 feature warning(s); re-run with -feature for details Future(Future(Future(Future(Future(List(1, 2, 3, 4, 5)))))) diff --git a/test/files/continuations-run/t5538.scala b/test/files/continuations-run/t5538.scala index 42f8163caf..6713cecf2f 100644 --- a/test/files/continuations-run/t5538.scala +++ b/test/files/continuations-run/t5538.scala @@ -1,6 +1,8 @@ import scala.util.continuations._ import scala.collection.generic.CanBuildFrom +import scala.language.{ implicitConversions } + object Test { class ExecutionContext @@ -43,8 +45,8 @@ object Test { } - def main(args: Array[String]) = { + def main(args: Array[String]) { val p = new PromiseStream[Int] println(Future.flow(p << (Future(1), Future(2), Future(3), Future(4), Future(5)))) } -}
\ No newline at end of file +} diff --git a/test/files/continuations-run/trycatch0.scala b/test/files/continuations-run/trycatch0.scala index ec39863f3f..feb7f7182b 100644 --- a/test/files/continuations-run/trycatch0.scala +++ b/test/files/continuations-run/trycatch0.scala @@ -7,14 +7,14 @@ object Test { def foo = try { shift((k: Int=>Int) => k(7)) } catch { - case ex => + case ex: Throwable => 9 } def bar = try { 7 } catch { - case ex => + case ex: Throwable => shiftUnit0[Int,Int](9) } @@ -22,4 +22,4 @@ object Test { println(reset { foo + 3 }) println(reset { bar + 3 }) } -}
\ No newline at end of file +} diff --git a/test/files/continuations-run/trycatch1.check b/test/files/continuations-run/trycatch1.check index a028d2b1e1..061ecdcd54 100644 --- a/test/files/continuations-run/trycatch1.check +++ b/test/files/continuations-run/trycatch1.check @@ -1,4 +1,10 @@ +trycatch1.scala:34: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + 7 + ^ +trycatch1.scala:18: warning: a pure expression does nothing in statement position; you may be omitting necessary parentheses + shift((k: Int=>Int) => k(7)) + ^ +12 12 12 12 -12
\ No newline at end of file diff --git a/test/files/continuations-run/trycatch1.scala b/test/files/continuations-run/trycatch1.scala index 10dfd30bb2..b00a87d059 100644 --- a/test/files/continuations-run/trycatch1.scala +++ b/test/files/continuations-run/trycatch1.scala @@ -10,7 +10,7 @@ object Test { fatal shift((k: Int=>Int) => k(7)) } catch { - case ex => + case ex: Throwable => 9 } @@ -18,7 +18,7 @@ object Test { shift((k: Int=>Int) => k(7)) fatal } catch { - case ex => + case ex: Throwable => 9 } @@ -26,7 +26,7 @@ object Test { fatal 7 } catch { - case ex => + case ex: Throwable => shiftUnit0[Int,Int](9) // regular shift causes no-symbol doesn't have owner } @@ -34,7 +34,7 @@ object Test { 7 fatal } catch { - case ex => + case ex: Throwable => shiftUnit0[Int,Int](9) // regular shift causes no-symbol doesn't have owner } @@ -45,4 +45,4 @@ object Test { println(reset { bar2 + 3 }) } -}
\ No newline at end of file +} diff --git a/test/files/continuations-run/while0.scala b/test/files/continuations-run/while0.scala index 46005a4a77..542408fb24 100644 --- a/test/files/continuations-run/while0.scala +++ b/test/files/continuations-run/while0.scala @@ -15,8 +15,8 @@ object Test { println(x) } - def main(args: Array[String]): Any = { + def main(args: Array[String]): Unit = { reset(test()) } -}
\ No newline at end of file +} diff --git a/test/files/continuations-run/while1.scala b/test/files/continuations-run/while1.scala index fd41ab36ee..351d52c27a 100644 --- a/test/files/continuations-run/while1.scala +++ b/test/files/continuations-run/while1.scala @@ -15,8 +15,8 @@ object Test { println(x) } - def main(args: Array[String]): Any = { + def main(args: Array[String]): Unit = { reset(test()) } -}
\ No newline at end of file +} diff --git a/test/files/continuations-run/while2.scala b/test/files/continuations-run/while2.scala index 63f9cb99fe..f4991dea61 100644 --- a/test/files/continuations-run/while2.scala +++ b/test/files/continuations-run/while2.scala @@ -16,8 +16,8 @@ object Test { println(x) } - def main(args: Array[String]): Any = { + def main(args: Array[String]): Unit = { reset(test()) } -}
\ No newline at end of file +} |