diff options
author | mihaylov <mihaylov@epfl.ch> | 2004-10-07 12:48:29 +0000 |
---|---|---|
committer | mihaylov <mihaylov@epfl.ch> | 2004-10-07 12:48:29 +0000 |
commit | 543531f94c0cf16d36888eee891d90caf9d0e4f9 (patch) | |
tree | 011f76e7b59756e896426c09acd43d34d4575e80 /test/files/run/tailcalls.scala | |
parent | 71643852e25289863db91d6594186f2f26b59efe (diff) | |
download | scala-543531f94c0cf16d36888eee891d90caf9d0e4f9.tar.gz scala-543531f94c0cf16d36888eee891d90caf9d0e4f9.tar.bz2 scala-543531f94c0cf16d36888eee891d90caf9d0e4f9.zip |
- Import java.lang.System.out and use out inste...
- Import java.lang.System.out and use out instead of System.out
Diffstat (limited to 'test/files/run/tailcalls.scala')
-rw-r--r-- | test/files/run/tailcalls.scala | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/test/files/run/tailcalls.scala b/test/files/run/tailcalls.scala index efec951d02..5646f17892 100644 --- a/test/files/run/tailcalls.scala +++ b/test/files/run/tailcalls.scala @@ -188,23 +188,23 @@ class TailCall[S](s: S) { // Test code object Test { - import java.lang.System; + import java.lang.System.out; def check_success(name: String, closure: => Int, expected: Int): Unit = { - System.out.print("test " + name); + out.print("test " + name); try { val actual: Int = closure; if (actual == expected) { - System.out.print(" was successful"); + out.print(" was successful"); } else { - System.out.print(" failed: expected "+ expected +", found "+ actual); + out.print(" failed: expected "+ expected +", found "+ actual); } } catch { case exception: Throwable => { - System.out.print(" raised exception " + exception); + out.print(" raised exception " + exception); } } - System.out.println(); + out.println(); } def calibrate: Int = { @@ -218,6 +218,7 @@ object Test { n = 2 * n; } catch { case exception: StackOverflowError => stop = true + //case exception: System.StackOverflowException => stop = true } } 4 * n; @@ -240,7 +241,7 @@ object Test { check_success("SubClass .f", SubClass .f(max, max), max); check_success("Sealed .f", Sealed .f(max, max), 0); check_success("SubSealed.f", SubSealed.f(max, max), max); - System.out.println(); + out.println(); // test tail calls in nested classes/objects val c: C = new C; @@ -274,7 +275,7 @@ object Test { check_success("c.c.O.c.f", c.c.O.c.f(max, max), 0); check_success("c.c.c.O.f", c.c.c.O.f(max, max), 0); check_success("c.c.c.c.f", c.c.c.c.f(max, max), 0); - System.out.println(); + out.println(); // test tail calls with different signatures val TailCall = new TailCall("S"); @@ -285,7 +286,7 @@ object Test { check_success("TailCall.g2", TailCall.g2(max, max ), 0); check_success("TailCall.g3", TailCall.g3(max, max, Nil), 0); check_success("TailCall.h1", TailCall.h1(max, max ), 0); - System.out.println(); + out.println(); } } |