From dbfdf0ec6d3ef0017b279dd9a195ce2615f9c3bb Mon Sep 17 00:00:00 2001 From: michelou Date: Tue, 10 Jun 2008 09:25:57 +0000 Subject: added EOLs, missing headers --- test/files/pos/bug704.scala | 2 +- test/files/run/amp.scala | 8 ++------ test/files/run/bugs.scala | 43 +++++++++++++++++++++---------------------- test/files/run/unapply.scala | 4 ++-- 4 files changed, 26 insertions(+), 31 deletions(-) (limited to 'test') diff --git a/test/files/pos/bug704.scala b/test/files/pos/bug704.scala index a05e0a51e7..e77a54a58e 100644 --- a/test/files/pos/bug704.scala +++ b/test/files/pos/bug704.scala @@ -5,7 +5,7 @@ trait D { } trait E extends D { - def f(): unit = { + def f(): Unit = { val y = "yyyy should appear twice" object yyyy { val x1 = get_xxxx diff --git a/test/files/run/amp.scala b/test/files/run/amp.scala index d46461ba20..367f3b31e4 100644 --- a/test/files/run/amp.scala +++ b/test/files/run/amp.scala @@ -1,19 +1,15 @@ object Test extends Application { def foo() = { - def f: int = 1 + def f: Int = 1 val x = f _ x } - def bar(g: => int) = { + def bar(g: => Int) = { g _ } Console.println((bar{ Console.println("g called"); 42 })()) Console.println(foo()()) - } - - - diff --git a/test/files/run/bugs.scala b/test/files/run/bugs.scala index 9339c1867f..2d0ad74628 100644 --- a/test/files/run/bugs.scala +++ b/test/files/run/bugs.scala @@ -272,7 +272,7 @@ object Bug226Test { def id[a](xs: Array[a]): Array[a] = xs; - def test(args: Array[String]): Unit = { + def test(args: Array[String]) { var xs = new Array[Int](1); class X { xs }; xs = id(xs); @@ -295,7 +295,7 @@ object Bug233Test { // Bug 250 object Bug250Test { - def test(args: Array[String]): Unit = { + def test(args: Array[String]) { if (true) null; () } @@ -316,7 +316,7 @@ object Bug257Test { f2(x); } - def test(args: Array[String]): Unit = { + def test(args: Array[String]) { f(sayhello())(sayhi()) } } @@ -333,16 +333,16 @@ abstract class Bug266AFoo { object Bug266ATest extends Bug266AFoo { type T = String; - class I1 extends I0 { def f(x: String): Unit = { Console.println("hello"); ();} } + class I1 extends I0 { def f(x: String) { Console.println("hello") } } def test(args: Array[String]): Unit = { new I1; () } } // version - B abstract class Bug266BA { - type t; + type t abstract class P { - def f(x: t): unit; + def f(x: t): Unit } } @@ -352,9 +352,9 @@ abstract class Bug266BA1 extends Bug266BA { } trait Bug266BB extends Bug266BA { - type t = int; + type t = Int; class P1 extends Bug266BB.this.P { - def f(x: int): unit = Console.println(x + 1); + def f(x: Int) { Console.println(x + 1) } } def mkP = new P1; val in = 3; @@ -368,7 +368,7 @@ object Bug266BTest { // main object Bug266Test { - def test(args: Array[String]): Unit = { + def test(args: Array[String]) { Bug266ATest.test(args); Bug266BTest.test(args); } @@ -378,8 +378,8 @@ object Bug266Test { // Bug 316 class Bug316MyIterator extends Iterator[Int] { - def hasNext = false; - def next = 42; + def hasNext = false + def next = 42 } object Bug316Test { @@ -391,7 +391,7 @@ object Bug316Test { // Bug 328 object Bug328Test { - def test0(f: Function1[Int,String]): Unit = (); + def test0(f: Function1[Int,String]) {} def test(args: Array[String]): Unit = test0(args); } @@ -430,7 +430,7 @@ object Bug399Test { (new G).f } - def test(args: Array[String]): Unit = { + def test(args: Array[String]) { Console.println(f("a")); } } @@ -439,24 +439,23 @@ object Bug399Test { // Main object Test { - var errors: Int = 0; - def test(bug: Int, test: => Unit): Unit = { - Console.println("<<< bug " + bug); + var errors: Int = 0 + def test(bug: Int, test: => Unit) { + Console.println("<<< bug " + bug) try { test; } catch { - case exception => { + case exception => val curr: String = currentThread.toString(); Console.print("Exception in thread \"" + curr + "\" " + exception); Console.println; - errors = errors + 1; - } + errors += 1 } - Console.println(">>> bug " + bug); - Console.println; + Console.println(">>> bug " + bug) + Console.println } - def main(args: Array[String]): Unit = { + def main(args: Array[String]) { test( 98, Bug98Test.test(args)); test(120, Bug120Test.test(args)); diff --git a/test/files/run/unapply.scala b/test/files/run/unapply.scala index b4efbda9fa..3325d034d3 100644 --- a/test/files/run/unapply.scala +++ b/test/files/run/unapply.scala @@ -17,7 +17,7 @@ class Bar { // test basic unapply for 0, 1 and 2 args and with precise type test object Fii { - def unapply(x: Any): boolean = x.isInstanceOf[Bar] + def unapply(x: Any): Boolean = x.isInstanceOf[Bar] } object Faa { def unapply(x: Any): Option[String] = if(x.isInstanceOf[Bar]) Some(x.asInstanceOf[Bar].name) else None @@ -105,7 +105,7 @@ object LisSeqArr extends TestCase("LisSeqArr") with Assert { object StreamFoo extends TestCase("unapply for Streams") with Assert { //val x:Stream[Int] = Stream.cons(1,x) - def sum(stream: Stream[int]): int = + def sum(stream: Stream[Int]): Int = stream match { case Stream.empty => 0 case Stream.cons(hd, tl) => hd + sum(tl) -- cgit v1.2.3