summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2010-10-04 06:22:31 +0000
committerPaul Phillips <paulp@improving.org>2010-10-04 06:22:31 +0000
commitc901a0675711a92ff714cfc909013a67a88c0ca3 (patch)
tree01e73b483cf3e372a0d7be0dab7edf7f2086b1d7 /test
parenta7fd7d6dc257e396cf2cf22a9e0a60c3ce44a992 (diff)
downloadscala-c901a0675711a92ff714cfc909013a67a88c0ca3.tar.gz
scala-c901a0675711a92ff714cfc909013a67a88c0ca3.tar.bz2
scala-c901a0675711a92ff714cfc909013a67a88c0ca3.zip
Another batch of busywork shuffling the content...
Another batch of busywork shuffling the contents of pending around. Can almost see some daylight. No review.
Diffstat (limited to 'test')
-rw-r--r--test/files/neg/t0565.check4
-rw-r--r--test/files/neg/t0565.scala (renamed from test/pending/run/t0565.scala)0
-rw-r--r--test/files/run/bug1042.check1
-rw-r--r--test/files/run/bug1042.scala (renamed from test/pending/run/bug1042.scala)2
-rw-r--r--test/files/run/preinits.check3
-rw-r--r--test/files/run/preinits.scala (renamed from test/pending/run/preinits.scala)0
-rw-r--r--test/files/run/t0048.check (renamed from test/pending/run/t0048.check)0
-rw-r--r--test/files/run/t0048.scala (renamed from test/pending/run/t0048.scala)2
-rw-r--r--test/pending/run/array_casts.check16
-rw-r--r--test/pending/run/array_casts.scala42
-rw-r--r--test/pending/run/arrays-2.check7
-rw-r--r--test/pending/run/arrays-2.scala25
-rw-r--r--test/pending/run/bug1006.check1
-rw-r--r--test/pending/run/bug1031.scala11
-rw-r--r--test/pending/run/castsingleton.check2
-rw-r--r--test/pending/run/mixins.scala6
-rw-r--r--test/pending/run/t0446.scala6
-rw-r--r--test/pending/run/t0727.check2
-rw-r--r--test/pending/run/t0727.scala5
-rw-r--r--test/pending/run/t0732.check3
-rw-r--r--test/pending/run/t0732.scala8
-rw-r--r--test/pending/run/t0818.scala4
-rw-r--r--test/pending/run/t0947.check1
-rw-r--r--test/pending/run/t0947.scala8
-rw-r--r--test/pending/run/t1044.scala5
-rw-r--r--test/pending/run/t1980.scala16
-rwxr-xr-xtest/pending/run/t3609.scala19
-rw-r--r--test/pending/run/treesetmap.check1
-rw-r--r--test/pending/run/treesetmap.scala5
29 files changed, 36 insertions, 169 deletions
diff --git a/test/files/neg/t0565.check b/test/files/neg/t0565.check
new file mode 100644
index 0000000000..c5a64d0e53
--- /dev/null
+++ b/test/files/neg/t0565.check
@@ -0,0 +1,4 @@
+t0565.scala:8: error: Parameter type in structural refinement may not refer to a type member of that refinement
+ def z (w : T) : T } =
+ ^
+one error found
diff --git a/test/pending/run/t0565.scala b/test/files/neg/t0565.scala
index eb6e32e644..eb6e32e644 100644
--- a/test/pending/run/t0565.scala
+++ b/test/files/neg/t0565.scala
diff --git a/test/files/run/bug1042.check b/test/files/run/bug1042.check
new file mode 100644
index 0000000000..223b7836fb
--- /dev/null
+++ b/test/files/run/bug1042.check
@@ -0,0 +1 @@
+B
diff --git a/test/pending/run/bug1042.scala b/test/files/run/bug1042.scala
index 26b06a6f0c..32eb49a7ec 100644
--- a/test/pending/run/bug1042.scala
+++ b/test/files/run/bug1042.scala
@@ -4,7 +4,7 @@ abstract class A {
def toString(sb: StringBuilder): StringBuilder // crucial
}
-case class B extends A {
+case class B() extends A {
// overloaded version is implemented, causing toString not to be implemented?
def toString(sb: StringBuilder): StringBuilder = error("")
}
diff --git a/test/files/run/preinits.check b/test/files/run/preinits.check
new file mode 100644
index 0000000000..5584ab261e
--- /dev/null
+++ b/test/files/run/preinits.check
@@ -0,0 +1,3 @@
+A
+B
+2
diff --git a/test/pending/run/preinits.scala b/test/files/run/preinits.scala
index 8de43b62ea..8de43b62ea 100644
--- a/test/pending/run/preinits.scala
+++ b/test/files/run/preinits.scala
diff --git a/test/pending/run/t0048.check b/test/files/run/t0048.check
index 1e8b314962..1e8b314962 100644
--- a/test/pending/run/t0048.check
+++ b/test/files/run/t0048.check
diff --git a/test/pending/run/t0048.scala b/test/files/run/t0048.scala
index 71f37d26e4..9ee3453cd9 100644
--- a/test/pending/run/t0048.scala
+++ b/test/files/run/t0048.scala
@@ -4,7 +4,7 @@ object A1 {
}
}
-object C {
+object Test {
def main(args: Array[String]) {
val q = new A1.A2.X
val res = 5 match { case q(x) => x }
diff --git a/test/pending/run/array_casts.check b/test/pending/run/array_casts.check
deleted file mode 100644
index f7d3e5036c..0000000000
--- a/test/pending/run/array_casts.check
+++ /dev/null
@@ -1,16 +0,0 @@
-is object - true
-is seq - true
-is collection - true
-is random-access-seq - true
-is random-access-seq-mutable - true
-not string - true
-not list - true
-class [I
-Array(10)
-Array(10)
-Array(10)
-Array(10)
-Good, arrays are not lists
-Good, arrays are not rich strings
-is-seq array true
-class [I
diff --git a/test/pending/run/array_casts.scala b/test/pending/run/array_casts.scala
deleted file mode 100644
index 0691fe06fe..0000000000
--- a/test/pending/run/array_casts.scala
+++ /dev/null
@@ -1,42 +0,0 @@
-object Test {
- val a = Array(10)
- def main(args : Array[String]) : Unit = {
- val a = this.a : AnyRef
- Console.println("is object - " + a.isInstanceOf[Object])
- Console.println("is seq - " + a.isInstanceOf[Seq[_]])
- Console.println("is collection - " + a.isInstanceOf[Collection[_]])
- Console.println("is random-access-seq - " + a.isInstanceOf[RandomAccessSeq[_]])
- Console.println("is random-access-seq-mutable - " + a.isInstanceOf[RandomAccessSeq.Mutable[_]])
- Console.println("not string - " + !a.isInstanceOf[String])
- Console.println("not list - " + !a.isInstanceOf[List[_]])
- try {
- Console.println(a.asInstanceOf[Object].getClass)
- } catch { case ex : ClassCastException => Console.println("Bad, arrays should be objects") }
- try {
- Console.println(a.asInstanceOf[Seq[_]])
- } catch { case ex : ClassCastException => Console.println("Bad, arrays should be seqs") }
- try {
- Console.println(a.asInstanceOf[Collection[_]])
- } catch { case ex : ClassCastException => Console.println("Bad, arrays should be collections") }
- try {
- Console.println(a.asInstanceOf[RandomAccessSeq[_]])
- } catch { case ex : ClassCastException => Console.println("Bad, arrays should be random access seqs") }
- try {
- Console.println(a.asInstanceOf[RandomAccessSeq.Mutable[_]])
- } catch { case ex : ClassCastException => Console.println("Bad, arrays should be mutable random access seqs") }
- try {
- Console.println("not expected: " + a.asInstanceOf[List[_]])
- } catch { case ex : ClassCastException => Console.println("Good, arrays are not lists") }
- try {
- Console.println("not expected: " + a.asInstanceOf[runtime.RichString])
- throw new Error("not expected")
- } catch { case ex : ClassCastException => Console.println("Good, arrays are not rich strings") }
- // check that arrays as seqs are still dynamically typed as arrays
- val s = this.a : Seq[Int]
- Console.println("is-seq array " + s.isInstanceOf[Array[Char]])
- try {
- Console.println(s.asInstanceOf[Array[Int]].getClass)
- } catch { case ex : ClassCastException => Console.println("Bad, arrays as seqs should still be arrays of Int") }
- ()
- }
-}
diff --git a/test/pending/run/arrays-2.check b/test/pending/run/arrays-2.check
deleted file mode 100644
index ce28533c20..0000000000
--- a/test/pending/run/arrays-2.check
+++ /dev/null
@@ -1,7 +0,0 @@
-a1=Array(3, 2, 1)
-a1=[3,2,1]
-a2=Array(0, 4, 2, 6)
-a2=[0,4,2,6]
-a2=[0,7,4,2,1,3,6,5]
-a2=[0,1,2,3,4,5,6,7]
-true
diff --git a/test/pending/run/arrays-2.scala b/test/pending/run/arrays-2.scala
deleted file mode 100644
index bee22db577..0000000000
--- a/test/pending/run/arrays-2.scala
+++ /dev/null
@@ -1,25 +0,0 @@
-//############################################################################
-// Arrays 2
-//############################################################################
-
-//############################################################################
-
-object Test extends Application {
- val a1 = Array(1, 2, 3)
- val a2 = Array(0, 7, 4, 2, 1, 3, 6, 5)
- val a3 = new Array(1, 2, 3) // ticket #193 (VerifyError)
-
- def _toString[A](a: Array[A]) = a.mkString("[", ",", "]")
-
- // slice: see file slices.scala
- println("a1=" + a1.reverse)
- println("a1=" + _toString(a1.reverse))
- println("a2=" + a2.filter(_ % 2 == 0))
- println("a2=" + _toString(a2.filter(_ % 2 == 0)))
-
- println("a2=" + _toString(a2))
- util.Sorting.stableSort(a2)
- println("a2=" + _toString(a2))
-
- println(a1 deepEquals a3)
-}
diff --git a/test/pending/run/bug1006.check b/test/pending/run/bug1006.check
deleted file mode 100644
index 409940768f..0000000000
--- a/test/pending/run/bug1006.check
+++ /dev/null
@@ -1 +0,0 @@
-23
diff --git a/test/pending/run/bug1031.scala b/test/pending/run/bug1031.scala
deleted file mode 100644
index 4db5674489..0000000000
--- a/test/pending/run/bug1031.scala
+++ /dev/null
@@ -1,11 +0,0 @@
-abstract class Tree
-case class Foo(xs: List[Int]) extends Tree
-
-object test extends Application {
- Foo(Nil) match {
- case Foo(xs: List[_]) =>
- Console.println(xs)
- case _ =>
- ;
- }
-}
diff --git a/test/pending/run/castsingleton.check b/test/pending/run/castsingleton.check
deleted file mode 100644
index 49742281f0..0000000000
--- a/test/pending/run/castsingleton.check
+++ /dev/null
@@ -1,2 +0,0 @@
-L()
-L()
diff --git a/test/pending/run/mixins.scala b/test/pending/run/mixins.scala
deleted file mode 100644
index c7926c9c53..0000000000
--- a/test/pending/run/mixins.scala
+++ /dev/null
@@ -1,6 +0,0 @@
-trait A { val x: Int }
-trait B extends A { override val x = 1 } // with A
-trait C extends A { override val x = 2 } // with A
-object Test extends B with C with Application {
- println(x)
-}
diff --git a/test/pending/run/t0446.scala b/test/pending/run/t0446.scala
deleted file mode 100644
index 0f74b32ba0..0000000000
--- a/test/pending/run/t0446.scala
+++ /dev/null
@@ -1,6 +0,0 @@
-object Test extends Application {
- val a = Array(1,3).takeWhile(_ < 2)
- val b = Array(1,3).dropWhile(_ < 2)
- println(a.toString)
- println(b.toString)
-}
diff --git a/test/pending/run/t0727.check b/test/pending/run/t0727.check
deleted file mode 100644
index bb101b641b..0000000000
--- a/test/pending/run/t0727.check
+++ /dev/null
@@ -1,2 +0,0 @@
-true
-true
diff --git a/test/pending/run/t0727.scala b/test/pending/run/t0727.scala
deleted file mode 100644
index 9f5be7c108..0000000000
--- a/test/pending/run/t0727.scala
+++ /dev/null
@@ -1,5 +0,0 @@
-object t0727 extends Application {
- val arr = Array("foo")
- println(arr.isInstanceOf[Array[String]])
- println(Array("foo").isInstanceOf[Array[String]])
-}
diff --git a/test/pending/run/t0732.check b/test/pending/run/t0732.check
deleted file mode 100644
index e4ec30754a..0000000000
--- a/test/pending/run/t0732.check
+++ /dev/null
@@ -1,3 +0,0 @@
-c
-
-c
diff --git a/test/pending/run/t0732.scala b/test/pending/run/t0732.scala
deleted file mode 100644
index 24fdba0017..0000000000
--- a/test/pending/run/t0732.scala
+++ /dev/null
@@ -1,8 +0,0 @@
-object t0732 extends Application {
- val x1 = <a b="c" />
- println(x1 \ "@b")
- val x2 = <a x:b="c" xmlns:x="uri" />
- println(x2 \ "@b")
- val x3 = <a x:b="c" xmlns:x="uri" />
- println(x3 \ "@x:b")
-}
diff --git a/test/pending/run/t0818.scala b/test/pending/run/t0818.scala
deleted file mode 100644
index 677b85d920..0000000000
--- a/test/pending/run/t0818.scala
+++ /dev/null
@@ -1,4 +0,0 @@
-object Seth extends Application {
- println(
- new java.util.ArrayList[String]().toArray(Array[String]()))
-}
diff --git a/test/pending/run/t0947.check b/test/pending/run/t0947.check
deleted file mode 100644
index e1431236cc..0000000000
--- a/test/pending/run/t0947.check
+++ /dev/null
@@ -1 +0,0 @@
-foo: test.Foo = Foo
diff --git a/test/pending/run/t0947.scala b/test/pending/run/t0947.scala
deleted file mode 100644
index 4297bb8777..0000000000
--- a/test/pending/run/t0947.scala
+++ /dev/null
@@ -1,8 +0,0 @@
-import scala.tools.nsc._
-
-object Test extends Application {
- class Foo { override def toString = "Foo" };
-
- val Int = new Interpreter(new Settings());
- Int.bind("foo", "Test.Foo", new Test.Foo());
-}
diff --git a/test/pending/run/t1044.scala b/test/pending/run/t1044.scala
deleted file mode 100644
index c521e5837b..0000000000
--- a/test/pending/run/t1044.scala
+++ /dev/null
@@ -1,5 +0,0 @@
-// looks OK
-object Main extends Application{
- val ducks = Array[AnyRef]("Huey", "Dewey", "Louie")
- ducks.iterator/*.asInstanceOf[Iterator[String]]*/
-}
diff --git a/test/pending/run/t1980.scala b/test/pending/run/t1980.scala
index 67cb3ada9e..38353c6270 100644
--- a/test/pending/run/t1980.scala
+++ b/test/pending/run/t1980.scala
@@ -1,9 +1,9 @@
-by-name argument incorrectly evaluated on :-ending operator
-Reported by: extempore Owned by: odersky
-Priority: normal Component: Compiler
-Keywords: Cc: paulp@…
-Fixed in version:
-Description
+// by-name argument incorrectly evaluated on :-ending operator
+// Reported by: extempore Owned by: odersky
+// Priority: normal Component: Compiler
+// Keywords: Cc: paulp@…
+// Fixed in version:
+// Description
scala> def foo() = { println("foo") ; 5 }
foo: ()Int
@@ -19,9 +19,9 @@ scala> c m1 foo()
scala> foo() m2_: c
foo
-But it is not evaluated if invoked directly:
+// But it is not evaluated if invoked directly:
scala> c.m2_:(foo())
-scala>
+// scala>
diff --git a/test/pending/run/t3609.scala b/test/pending/run/t3609.scala
index 262948137d..030b417044 100755
--- a/test/pending/run/t3609.scala
+++ b/test/pending/run/t3609.scala
@@ -3,9 +3,26 @@ object Test extends Application {
class B extends A
def foo(x: A, y: B) = print(1)
val foo = new {
- //def apply(x: B, y: A) = print(3)
+ // def apply(x: B, y: A) = print(3)
def apply = (x: B, z: B) => print(4)
}
foo(new B, new B)
}
+
+// This code prints 1. If we remove comment, then it will print 4.
+// Moreover following code prints 3 (which is most strange thing):
+
+object Test2 extends Application {
+ class A
+ class B extends A
+ def foo(x: A, y: B) = print(1)
+ val foo = new {
+ def apply(x: B, y: A) = print(3)
+ def apply = new {
+ def apply = (x: B, z: B) => print(4)
+ }
+ }
+
+ foo(new B, new B)
+} \ No newline at end of file
diff --git a/test/pending/run/treesetmap.check b/test/pending/run/treesetmap.check
deleted file mode 100644
index c55dc061db..0000000000
--- a/test/pending/run/treesetmap.check
+++ /dev/null
@@ -1 +0,0 @@
-class scala.collection.immutable.TreeMap
diff --git a/test/pending/run/treesetmap.scala b/test/pending/run/treesetmap.scala
deleted file mode 100644
index 60902d2b90..0000000000
--- a/test/pending/run/treesetmap.scala
+++ /dev/null
@@ -1,5 +0,0 @@
-object Test{
- def main(args : Array[String]){
- println(scala.collection.immutable.TreeSet(1, 2, 3).map(x => x).getClass);
- }
-}