summaryrefslogtreecommitdiff
path: root/test/files
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2009-10-07 17:07:27 +0000
committerPaul Phillips <paulp@improving.org>2009-10-07 17:07:27 +0000
commit6b31849b85532946cb90b2552cb451b58dbd884d (patch)
tree6c343195529c27d43710ae14f77ffc079ccc3ebb /test/files
parent9f121f57e034a7feb07bad7f67403f3ac75b46d4 (diff)
downloadscala-6b31849b85532946cb90b2552cb451b58dbd884d.tar.gz
scala-6b31849b85532946cb90b2552cb451b58dbd884d.tar.bz2
scala-6b31849b85532946cb90b2552cb451b58dbd884d.zip
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.
Diffstat (limited to 'test/files')
-rw-r--r--test/files/jvm/t1801.check6
-rw-r--r--test/files/jvm/t1801.scala31
-rw-r--r--test/files/pos/bug1136.check2
-rw-r--r--test/files/pos/bug2023.scala16
-rw-r--r--test/files/pos/bug2261.scala6
-rw-r--r--test/files/pos/switchUnbox.flags1
-rw-r--r--test/files/pos/switchUnbox.scala11
-rw-r--r--test/files/pos/t1000.scala3
-rw-r--r--test/files/pos/t1659.check5
-rw-r--r--test/files/pos/t1722.scala10
-rwxr-xr-xtest/files/pos/t1722/C.scala9
-rwxr-xr-xtest/files/pos/t1722/Test.scala4
-rwxr-xr-xtest/files/pos/t1722/Top.scala13
-rw-r--r--test/files/pos/t1798.scala10
-rw-r--r--test/files/pos/t1987.scala8
-rw-r--r--test/files/run/bug2005.scala10
16 files changed, 138 insertions, 7 deletions
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
+ }
+}