From 6b31849b85532946cb90b2552cb451b58dbd884d Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Wed, 7 Oct 2009 17:07:27 +0000 Subject: Moved a pile of passing tests from pending to f... Moved a pile of passing tests from pending to files, fixed some untesty tests, and will now close the associated tickets. --- test/files/jvm/t1801.check | 6 +++++ test/files/jvm/t1801.scala | 31 +++++++++++++++++++++++ test/files/pos/bug1136.check | 2 -- test/files/pos/bug2023.scala | 16 ++++++++++++ test/files/pos/bug2261.scala | 6 +++++ test/files/pos/switchUnbox.flags | 1 + test/files/pos/switchUnbox.scala | 11 ++++++++ test/files/pos/t1000.scala | 3 +++ test/files/pos/t1659.check | 5 ---- test/files/pos/t1722.scala | 10 ++++++++ test/files/pos/t1722/C.scala | 9 +++++++ test/files/pos/t1722/Test.scala | 4 +++ test/files/pos/t1722/Top.scala | 13 ++++++++++ test/files/pos/t1798.scala | 10 ++++++++ test/files/pos/t1987.scala | 8 ++++++ test/files/run/bug2005.scala | 10 ++++++++ test/pending/jvm/t1801.check | 6 ----- test/pending/jvm/t1801.scala | 31 ----------------------- test/pending/pos/bug2005.scala | 10 -------- test/pending/pos/bug2023.scala | 16 ------------ test/pending/pos/bug2261.scala | 6 ----- test/pending/pos/switchUnbox.flags | 1 - test/pending/pos/switchUnbox.scala | 11 -------- test/pending/pos/t1000.scala | 3 --- test/pending/pos/t1722.scala | 10 -------- test/pending/pos/t1722/C.scala | 9 ------- test/pending/pos/t1722/Test.scala | 4 --- test/pending/pos/t1722/Top.scala | 13 ---------- test/pending/pos/t1798.scala | 10 -------- test/pending/pos/t1987.scala | 8 ------ test/pending/pos/t2201.scala | 8 ------ test/pending/run/bugs425-and-816.scala | 46 ++++++++++++---------------------- test/pending/run/t2005.scala | 24 ------------------ 33 files changed, 154 insertions(+), 207 deletions(-) create mode 100644 test/files/jvm/t1801.check create mode 100644 test/files/jvm/t1801.scala delete mode 100644 test/files/pos/bug1136.check create mode 100644 test/files/pos/bug2023.scala create mode 100644 test/files/pos/bug2261.scala create mode 100644 test/files/pos/switchUnbox.flags create mode 100644 test/files/pos/switchUnbox.scala create mode 100644 test/files/pos/t1000.scala delete mode 100644 test/files/pos/t1659.check create mode 100644 test/files/pos/t1722.scala create mode 100755 test/files/pos/t1722/C.scala create mode 100755 test/files/pos/t1722/Test.scala create mode 100755 test/files/pos/t1722/Top.scala create mode 100644 test/files/pos/t1798.scala create mode 100644 test/files/pos/t1987.scala create mode 100644 test/files/run/bug2005.scala delete mode 100644 test/pending/jvm/t1801.check delete mode 100644 test/pending/jvm/t1801.scala delete mode 100644 test/pending/pos/bug2005.scala delete mode 100644 test/pending/pos/bug2023.scala delete mode 100644 test/pending/pos/bug2261.scala delete mode 100644 test/pending/pos/switchUnbox.flags delete mode 100644 test/pending/pos/switchUnbox.scala delete mode 100644 test/pending/pos/t1000.scala delete mode 100644 test/pending/pos/t1722.scala delete mode 100755 test/pending/pos/t1722/C.scala delete mode 100755 test/pending/pos/t1722/Test.scala delete mode 100755 test/pending/pos/t1722/Top.scala delete mode 100644 test/pending/pos/t1798.scala delete mode 100644 test/pending/pos/t1987.scala delete mode 100644 test/pending/pos/t2201.scala delete mode 100644 test/pending/run/t2005.scala (limited to 'test') diff --git a/test/files/jvm/t1801.check b/test/files/jvm/t1801.check new file mode 100644 index 0000000000..bf78a99db9 --- /dev/null +++ b/test/files/jvm/t1801.check @@ -0,0 +1,6 @@ +0 +100 +200 +300 +400 +done! diff --git a/test/files/jvm/t1801.scala b/test/files/jvm/t1801.scala new file mode 100644 index 0000000000..6ed7c56336 --- /dev/null +++ b/test/files/jvm/t1801.scala @@ -0,0 +1,31 @@ +import scala.actors.Actor._ + +object Test { + val rt = Runtime.getRuntime() + val sender = actor { + var cnt = 0 + while(cnt < 500) { + if ((cnt % 100) == 0) println(cnt) + receiver ! new Array[Int] (148576) + cnt += 1 + //println ("Used Mem: " + (((rt.totalMemory() - rt.freeMemory()) / 1048576.) formatted "%.2f") + " Mb") + } + receiver ! 'exit + } + + val receiver = actor { + loop { + react { + case x: Array[Int] => ()//println ("received " + x.length) + case 'exit => { + println("done!") + exit() + } + } + } + } + + def main (args: Array[String]) { + sender + } +} diff --git a/test/files/pos/bug1136.check b/test/files/pos/bug1136.check deleted file mode 100644 index 0747cddefb..0000000000 --- a/test/files/pos/bug1136.check +++ /dev/null @@ -1,2 +0,0 @@ -warning: there were unchecked warnings; re-run with -unchecked for details -one warning found diff --git a/test/files/pos/bug2023.scala b/test/files/pos/bug2023.scala new file mode 100644 index 0000000000..21c6fc96a6 --- /dev/null +++ b/test/files/pos/bug2023.scala @@ -0,0 +1,16 @@ +trait C[A] + +object C { + implicit def ipl[A](implicit from: A => Ordered[A]): C[A] = null +} + +object P { + def foo[A](i: A, j: A)(implicit c: C[A]): Unit = () +} + +class ImplicitChainTest { + def testTrivial: Unit = { + P.foo('0', '9') + P.foo('0', '9') + } +} diff --git a/test/files/pos/bug2261.scala b/test/files/pos/bug2261.scala new file mode 100644 index 0000000000..a499af838a --- /dev/null +++ b/test/files/pos/bug2261.scala @@ -0,0 +1,6 @@ +object Test extends Application { + class Bob[T] + implicit def foo2bar[T](xs: List[T]): Bob[T] = new Bob[T] + var x: Bob[Int] = null + x = List(1,2,3) +} diff --git a/test/files/pos/switchUnbox.flags b/test/files/pos/switchUnbox.flags new file mode 100644 index 0000000000..ec1ad20e3a --- /dev/null +++ b/test/files/pos/switchUnbox.flags @@ -0,0 +1 @@ +-Xsqueeze:on diff --git a/test/files/pos/switchUnbox.scala b/test/files/pos/switchUnbox.scala new file mode 100644 index 0000000000..a97bff5521 --- /dev/null +++ b/test/files/pos/switchUnbox.scala @@ -0,0 +1,11 @@ +// this test has accompanying .flags file +// that contains -Xsqueeze:on +// +object Foo { + var xyz: (int, String) = (1, "abc") + xyz._1 match { + case 1 => Console.println("OK") + case 2 => Console.println("OK") + case _ => Console.println("KO") + } +} diff --git a/test/files/pos/t1000.scala b/test/files/pos/t1000.scala new file mode 100644 index 0000000000..38f71863d8 --- /dev/null +++ b/test/files/pos/t1000.scala @@ -0,0 +1,3 @@ +object A { + println("""This a "raw" string ending with a "double quote"""") +} diff --git a/test/files/pos/t1659.check b/test/files/pos/t1659.check deleted file mode 100644 index b75da8798b..0000000000 --- a/test/files/pos/t1659.check +++ /dev/null @@ -1,5 +0,0 @@ -t1659.scala:3: error: overriding method u in trait W of type [A](v: Y{type X = A})Unit; - method u has incompatible type -class Z extends W { def u[A](v : Y { type X = A }) = null } - ^ -one error found diff --git a/test/files/pos/t1722.scala b/test/files/pos/t1722.scala new file mode 100644 index 0000000000..d059bf22f8 --- /dev/null +++ b/test/files/pos/t1722.scala @@ -0,0 +1,10 @@ +sealed trait Top +trait C { + private object P extends Top +} +/* +$ scala -e 'new AnyRef with C' +error: error while loading Top, class file '/private/tmp/bobobo/./Top.class' is broken +(error reading Scala signature of /private/tmp/bobobo/./Top.class: malformed Scala signature of Top at 185; reference value P of trait C refers to nonexisting symbol.) +one error found +*/ diff --git a/test/files/pos/t1722/C.scala b/test/files/pos/t1722/C.scala new file mode 100755 index 0000000000..2695296292 --- /dev/null +++ b/test/files/pos/t1722/C.scala @@ -0,0 +1,9 @@ +trait C { + private object P extends Top +} +/* +$ scala -e 'new AnyRef with C' +error: error while loading Top, class file '/private/tmp/bobobo/./Top.class' is broken +(error reading Scala signature of /private/tmp/bobobo/./Top.class: malformed Scala signature of Top at 185; reference value P of trait C refers to nonexisting symbol.) +one error found +*/ diff --git a/test/files/pos/t1722/Test.scala b/test/files/pos/t1722/Test.scala new file mode 100755 index 0000000000..4cba7ab01b --- /dev/null +++ b/test/files/pos/t1722/Test.scala @@ -0,0 +1,4 @@ +package t1722 +object Test { + val x = new AnyRef with C +} diff --git a/test/files/pos/t1722/Top.scala b/test/files/pos/t1722/Top.scala new file mode 100755 index 0000000000..4ac52412aa --- /dev/null +++ b/test/files/pos/t1722/Top.scala @@ -0,0 +1,13 @@ +package t1722 + +sealed trait Top +trait C { + private object P extends Top +} +/* +$ scala -e 'new AnyRef with C' +error: error while loading Top, class file '/private/tmp/bobobo/./Top.class' is broken +(error reading Scala signature of /private/tmp/bobobo/./Top.class: malformed Scala signature of Top at 185; reference value P of trait C refers to nonexisting symbol.) +one error found +Martin: I think this has to do with children property. +*/ diff --git a/test/files/pos/t1798.scala b/test/files/pos/t1798.scala new file mode 100644 index 0000000000..1624e3025e --- /dev/null +++ b/test/files/pos/t1798.scala @@ -0,0 +1,10 @@ +object Foo { private def bar(): Int = 55 } +class Foo(x: Int) { def this() = this(Foo.bar()) } + +/* + * scalac28 a.scala +a.scala:2: error: method bar cannot be accessed in object Foo +class Foo(x: Int) { def this() = this(Foo.bar()) } + ^ +one error found +*/ diff --git a/test/files/pos/t1987.scala b/test/files/pos/t1987.scala new file mode 100644 index 0000000000..ccab133716 --- /dev/null +++ b/test/files/pos/t1987.scala @@ -0,0 +1,8 @@ +package object overloading { + def bar(f: (Int) => Unit): Unit = () + def bar(f: (Int, Int) => Unit): Unit = () +} + +class PackageObjectOverloadingTest { + overloading.bar( (i: Int) => () ) // doesn't compile. +} diff --git a/test/files/run/bug2005.scala b/test/files/run/bug2005.scala new file mode 100644 index 0000000000..4176709537 --- /dev/null +++ b/test/files/run/bug2005.scala @@ -0,0 +1,10 @@ +object Test { + def main(args: Array[String]) { + val a = new Array[Array[Int]](2,2) + test(a) + } + def test[A](t: Array[Array[A]]) { + val tmp = t(0) + t(1) = tmp + } +} diff --git a/test/pending/jvm/t1801.check b/test/pending/jvm/t1801.check deleted file mode 100644 index bf78a99db9..0000000000 --- a/test/pending/jvm/t1801.check +++ /dev/null @@ -1,6 +0,0 @@ -0 -100 -200 -300 -400 -done! diff --git a/test/pending/jvm/t1801.scala b/test/pending/jvm/t1801.scala deleted file mode 100644 index 6ed7c56336..0000000000 --- a/test/pending/jvm/t1801.scala +++ /dev/null @@ -1,31 +0,0 @@ -import scala.actors.Actor._ - -object Test { - val rt = Runtime.getRuntime() - val sender = actor { - var cnt = 0 - while(cnt < 500) { - if ((cnt % 100) == 0) println(cnt) - receiver ! new Array[Int] (148576) - cnt += 1 - //println ("Used Mem: " + (((rt.totalMemory() - rt.freeMemory()) / 1048576.) formatted "%.2f") + " Mb") - } - receiver ! 'exit - } - - val receiver = actor { - loop { - react { - case x: Array[Int] => ()//println ("received " + x.length) - case 'exit => { - println("done!") - exit() - } - } - } - } - - def main (args: Array[String]) { - sender - } -} diff --git a/test/pending/pos/bug2005.scala b/test/pending/pos/bug2005.scala deleted file mode 100644 index 2514a5f711..0000000000 --- a/test/pending/pos/bug2005.scala +++ /dev/null @@ -1,10 +0,0 @@ -object Bug { - def main(args: Array[String]) { - val a = new Array[Array[Int]](2,2) - test(a) - } - def test[A](t: Array[Array[A]]) { - val tmp = t(0) - t(1) = tmp - } -} diff --git a/test/pending/pos/bug2023.scala b/test/pending/pos/bug2023.scala deleted file mode 100644 index 21c6fc96a6..0000000000 --- a/test/pending/pos/bug2023.scala +++ /dev/null @@ -1,16 +0,0 @@ -trait C[A] - -object C { - implicit def ipl[A](implicit from: A => Ordered[A]): C[A] = null -} - -object P { - def foo[A](i: A, j: A)(implicit c: C[A]): Unit = () -} - -class ImplicitChainTest { - def testTrivial: Unit = { - P.foo('0', '9') - P.foo('0', '9') - } -} diff --git a/test/pending/pos/bug2261.scala b/test/pending/pos/bug2261.scala deleted file mode 100644 index a499af838a..0000000000 --- a/test/pending/pos/bug2261.scala +++ /dev/null @@ -1,6 +0,0 @@ -object Test extends Application { - class Bob[T] - implicit def foo2bar[T](xs: List[T]): Bob[T] = new Bob[T] - var x: Bob[Int] = null - x = List(1,2,3) -} diff --git a/test/pending/pos/switchUnbox.flags b/test/pending/pos/switchUnbox.flags deleted file mode 100644 index ec1ad20e3a..0000000000 --- a/test/pending/pos/switchUnbox.flags +++ /dev/null @@ -1 +0,0 @@ --Xsqueeze:on diff --git a/test/pending/pos/switchUnbox.scala b/test/pending/pos/switchUnbox.scala deleted file mode 100644 index a97bff5521..0000000000 --- a/test/pending/pos/switchUnbox.scala +++ /dev/null @@ -1,11 +0,0 @@ -// this test has accompanying .flags file -// that contains -Xsqueeze:on -// -object Foo { - var xyz: (int, String) = (1, "abc") - xyz._1 match { - case 1 => Console.println("OK") - case 2 => Console.println("OK") - case _ => Console.println("KO") - } -} diff --git a/test/pending/pos/t1000.scala b/test/pending/pos/t1000.scala deleted file mode 100644 index 38f71863d8..0000000000 --- a/test/pending/pos/t1000.scala +++ /dev/null @@ -1,3 +0,0 @@ -object A { - println("""This a "raw" string ending with a "double quote"""") -} diff --git a/test/pending/pos/t1722.scala b/test/pending/pos/t1722.scala deleted file mode 100644 index d059bf22f8..0000000000 --- a/test/pending/pos/t1722.scala +++ /dev/null @@ -1,10 +0,0 @@ -sealed trait Top -trait C { - private object P extends Top -} -/* -$ scala -e 'new AnyRef with C' -error: error while loading Top, class file '/private/tmp/bobobo/./Top.class' is broken -(error reading Scala signature of /private/tmp/bobobo/./Top.class: malformed Scala signature of Top at 185; reference value P of trait C refers to nonexisting symbol.) -one error found -*/ diff --git a/test/pending/pos/t1722/C.scala b/test/pending/pos/t1722/C.scala deleted file mode 100755 index 2695296292..0000000000 --- a/test/pending/pos/t1722/C.scala +++ /dev/null @@ -1,9 +0,0 @@ -trait C { - private object P extends Top -} -/* -$ scala -e 'new AnyRef with C' -error: error while loading Top, class file '/private/tmp/bobobo/./Top.class' is broken -(error reading Scala signature of /private/tmp/bobobo/./Top.class: malformed Scala signature of Top at 185; reference value P of trait C refers to nonexisting symbol.) -one error found -*/ diff --git a/test/pending/pos/t1722/Test.scala b/test/pending/pos/t1722/Test.scala deleted file mode 100755 index 4cba7ab01b..0000000000 --- a/test/pending/pos/t1722/Test.scala +++ /dev/null @@ -1,4 +0,0 @@ -package t1722 -object Test { - val x = new AnyRef with C -} diff --git a/test/pending/pos/t1722/Top.scala b/test/pending/pos/t1722/Top.scala deleted file mode 100755 index 4ac52412aa..0000000000 --- a/test/pending/pos/t1722/Top.scala +++ /dev/null @@ -1,13 +0,0 @@ -package t1722 - -sealed trait Top -trait C { - private object P extends Top -} -/* -$ scala -e 'new AnyRef with C' -error: error while loading Top, class file '/private/tmp/bobobo/./Top.class' is broken -(error reading Scala signature of /private/tmp/bobobo/./Top.class: malformed Scala signature of Top at 185; reference value P of trait C refers to nonexisting symbol.) -one error found -Martin: I think this has to do with children property. -*/ diff --git a/test/pending/pos/t1798.scala b/test/pending/pos/t1798.scala deleted file mode 100644 index 1624e3025e..0000000000 --- a/test/pending/pos/t1798.scala +++ /dev/null @@ -1,10 +0,0 @@ -object Foo { private def bar(): Int = 55 } -class Foo(x: Int) { def this() = this(Foo.bar()) } - -/* - * scalac28 a.scala -a.scala:2: error: method bar cannot be accessed in object Foo -class Foo(x: Int) { def this() = this(Foo.bar()) } - ^ -one error found -*/ diff --git a/test/pending/pos/t1987.scala b/test/pending/pos/t1987.scala deleted file mode 100644 index ccab133716..0000000000 --- a/test/pending/pos/t1987.scala +++ /dev/null @@ -1,8 +0,0 @@ -package object overloading { - def bar(f: (Int) => Unit): Unit = () - def bar(f: (Int, Int) => Unit): Unit = () -} - -class PackageObjectOverloadingTest { - overloading.bar( (i: Int) => () ) // doesn't compile. -} diff --git a/test/pending/pos/t2201.scala b/test/pending/pos/t2201.scala deleted file mode 100644 index 21af170cf1..0000000000 --- a/test/pending/pos/t2201.scala +++ /dev/null @@ -1,8 +0,0 @@ -class Test -object Test { implicit def view(x : Test) = 0 } - -object Call { - def call(implicit view : Test => Int) = view(null) - call - call -} diff --git a/test/pending/run/bugs425-and-816.scala b/test/pending/run/bugs425-and-816.scala index 4e841ccc31..d9267d06af 100644 --- a/test/pending/run/bugs425-and-816.scala +++ b/test/pending/run/bugs425-and-816.scala @@ -1,41 +1,27 @@ object Test { - object bug816 { - abstract class Atest(val data: String) - case class Btest(override val data: String, val b: Boolean) extends Atest(data) - case class Ctest(override val data: String) extends Btest(data, true) - - class testCaseClass { - def test(x: Atest) = x match { - case Ctest(data) => "C" - case Btest(data, b) => "B" - } - } - def go() = { - val tcc = new testCaseClass() - - tcc.test(Ctest("foo")) + tcc.test(Btest("bar", true)) - } - } - object bug425 { case class A(x: Int) case class B(override val x: Int, y: Double) extends A(x) val b: A = B(5, 3.3) - def flail = b match { - case B(x, y) => "B" - case A(x) => "A" + b match { + case B(x, y) => Console.println(y) + case A(x) => Console.println(x) } - def flail2 = (B(10, 5.5): Any) match { - case A(20) => "1" - case A(10) => "2" - case _ => "fail" - } - def go() = flail + flail2 } - def main(args: Array[String]): Unit = { - assert(bug816.go() == "CB") - assert(bug425.go() == "B2") + object bug816 { + abstract class Atest(val data: String) + + case class Btest(override val data: String, val b: boolean) extends Atest(data) + + case class Ctest(override val data: String) extends Btest(data, true) + + class testCaseClass { + def test(x: Atest) = x match { + case Ctest(data) => Console.println("C") + case Btest(data, b) => Console.println("B") + } + } } } diff --git a/test/pending/run/t2005.scala b/test/pending/run/t2005.scala deleted file mode 100644 index 8e4243a768..0000000000 --- a/test/pending/run/t2005.scala +++ /dev/null @@ -1,24 +0,0 @@ -Object Bug { - def main(args: Array[String]) { - val a = new Array[Array[Int]](2,2) - test(a) - } - def test[A](t: Array[Array[A]]) { - val tmp = t(0) - t(1) = tmp - } -} -java.lang.ArrayStoreException: scala.runtime.BoxedIntArray - at scala.runtime.BoxedObjectArray.update(BoxedObjectArray.scala:26) - at Bug$.test(Bug.scala:12) - at Bug$.main(Bug.scala:7) - at Bug.main(Bug.scala) - at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) - at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) - at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) - at java.lang.reflect.Method.invoke(Method.java:585) - at scala.tools.nsc.ObjectRunner$$anonfun$run$1.apply(ObjectRunner.scala:75) - at scala.tools.nsc.ObjectRunner$.withContextClassLoader(ObjectRunner.scala:49) - at scala.tools.nsc.ObjectRunner$.run(ObjectRunner.scala:74) - at scala.tools.nsc.MainGenericRunner$.main(MainGenericRunner.scala:154) - at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala) -- cgit v1.2.3