summaryrefslogtreecommitdiff
path: root/test/pending
diff options
context:
space:
mode:
Diffstat (limited to 'test/pending')
-rw-r--r--test/pending/continuations-pos/t3620.scala73
-rw-r--r--test/pending/continuations-run/example0.scala9
-rw-r--r--test/pending/continuations-run/example1.scala9
-rw-r--r--test/pending/continuations-run/example16.scala9
-rw-r--r--test/pending/continuations-run/example2.scala9
-rw-r--r--test/pending/continuations-run/example3.scala9
-rw-r--r--test/pending/continuations-run/example4.scala9
-rw-r--r--test/pending/continuations-run/example5.scala9
-rw-r--r--test/pending/continuations-run/example6.scala9
-rw-r--r--test/pending/continuations-run/example7.scala9
-rw-r--r--test/pending/continuations-run/example8.scala9
-rw-r--r--test/pending/continuations-run/example9.scala9
-rw-r--r--test/pending/continuations-run/foreach.check4
-rw-r--r--test/pending/continuations-run/foreach.scala33
-rw-r--r--test/pending/neg/t2066.scala16
-rw-r--r--test/pending/presentation/context-bounds1.check51
-rw-r--r--test/pending/presentation/context-bounds1/Test.scala3
-rw-r--r--test/pending/presentation/context-bounds1/src/ContextBounds.scala13
-rw-r--r--test/pending/run/idempotency-partial-functions.scala2
-rw-r--r--test/pending/run/reflection-sync-potpourri.scala32
-rw-r--r--test/pending/run/t5943b1.scala2
21 files changed, 101 insertions, 227 deletions
diff --git a/test/pending/continuations-pos/t3620.scala b/test/pending/continuations-pos/t3620.scala
deleted file mode 100644
index 8496ae2858..0000000000
--- a/test/pending/continuations-pos/t3620.scala
+++ /dev/null
@@ -1,73 +0,0 @@
-import scala.collection.mutable.HashMap
-import scala.util.continuations._
-
-object Test extends Application {
-
- class Store[K,V] {
-
- trait Waiting {
- def key: K
- def inform(value: V): Unit
- }
-
- private val map = new HashMap[K, V]
- private var waiting: List[Waiting] = Nil
-
- def waitFor(k: K, f: (V => Unit)) {
- map.get(k) match {
- case Some(v) => f(v)
- case None => {
- val w = new Waiting {
- def key = k
- def inform(v: V) = f(v)
- }
- waiting = w :: waiting
- }
- }
- }
-
-
- def add(key: K, value: V) {
- map(key) = value
- val p = waiting.partition(_.key == key)
- waiting = p._2
- p._1.foreach(_.inform(value))
- }
-
- def required(key: K) = {
- shift {
- c: (V => Unit) => {
- waitFor(key, c)
- }
- }
- }
-
- def option(key: Option[K]) = {
- shift {
- c: (Option[V] => Unit) => {
- key match {
- case Some(key) => waitFor(key, (v: V) => c(Some(v)))
- case None => c(None)
- }
-
- }
- }
- }
-
- }
-
- val store = new Store[String, Int]
-
- def test(p: Option[String]): Unit = {
- reset {
- // uncommenting the following two lines makes the compiler happy!
-// val o = store.option(p)
-// println(o)
- val i = store.option(p).getOrElse(1)
- println(i)
- }
- }
-
- test(Some("a"))
-
-}
diff --git a/test/pending/continuations-run/example0.scala b/test/pending/continuations-run/example0.scala
deleted file mode 100644
index de5ea54e9d..0000000000
--- a/test/pending/continuations-run/example0.scala
+++ /dev/null
@@ -1,9 +0,0 @@
-// $Id$
-
-object Test {
-
- def main(args: Array[String]): Any = {
- examples.continuations.Test0.main(args)
- }
-
-} \ No newline at end of file
diff --git a/test/pending/continuations-run/example1.scala b/test/pending/continuations-run/example1.scala
deleted file mode 100644
index e31d6af88c..0000000000
--- a/test/pending/continuations-run/example1.scala
+++ /dev/null
@@ -1,9 +0,0 @@
-// $Id$
-
-object Test {
-
- def main(args: Array[String]): Any = {
- examples.continuations.Test1.main(args)
- }
-
-} \ No newline at end of file
diff --git a/test/pending/continuations-run/example16.scala b/test/pending/continuations-run/example16.scala
deleted file mode 100644
index 561f0ab0eb..0000000000
--- a/test/pending/continuations-run/example16.scala
+++ /dev/null
@@ -1,9 +0,0 @@
-// $Id$
-
-object Test {
-
- def main(args: Array[String]): Any = {
- examples.continuations.Test16Printf.main(args)
- }
-
-} \ No newline at end of file
diff --git a/test/pending/continuations-run/example2.scala b/test/pending/continuations-run/example2.scala
deleted file mode 100644
index 730f7cc63e..0000000000
--- a/test/pending/continuations-run/example2.scala
+++ /dev/null
@@ -1,9 +0,0 @@
-// $Id$
-
-object Test {
-
- def main(args: Array[String]): Any = {
- examples.continuations.Test2.main(args)
- }
-
-} \ No newline at end of file
diff --git a/test/pending/continuations-run/example3.scala b/test/pending/continuations-run/example3.scala
deleted file mode 100644
index 41cf1cce0c..0000000000
--- a/test/pending/continuations-run/example3.scala
+++ /dev/null
@@ -1,9 +0,0 @@
-// $Id$
-
-object Test {
-
- def main(args: Array[String]): Any = {
- examples.continuations.Test3.main(args)
- }
-
-} \ No newline at end of file
diff --git a/test/pending/continuations-run/example4.scala b/test/pending/continuations-run/example4.scala
deleted file mode 100644
index adcc7aa90e..0000000000
--- a/test/pending/continuations-run/example4.scala
+++ /dev/null
@@ -1,9 +0,0 @@
-// $Id$
-
-object Test {
-
- def main(args: Array[String]): Any = {
- examples.continuations.Test4.main(args)
- }
-
-} \ No newline at end of file
diff --git a/test/pending/continuations-run/example5.scala b/test/pending/continuations-run/example5.scala
deleted file mode 100644
index 241e8cd069..0000000000
--- a/test/pending/continuations-run/example5.scala
+++ /dev/null
@@ -1,9 +0,0 @@
-// $Id$
-
-object Test {
-
- def main(args: Array[String]): Any = {
- examples.continuations.Test5.main(args)
- }
-
-} \ No newline at end of file
diff --git a/test/pending/continuations-run/example6.scala b/test/pending/continuations-run/example6.scala
deleted file mode 100644
index 00f84fcd6c..0000000000
--- a/test/pending/continuations-run/example6.scala
+++ /dev/null
@@ -1,9 +0,0 @@
-// $Id$
-
-object Test {
-
- def main(args: Array[String]): Any = {
- examples.continuations.Test6.main(args)
- }
-
-} \ No newline at end of file
diff --git a/test/pending/continuations-run/example7.scala b/test/pending/continuations-run/example7.scala
deleted file mode 100644
index 64abc6d9a6..0000000000
--- a/test/pending/continuations-run/example7.scala
+++ /dev/null
@@ -1,9 +0,0 @@
-// $Id$
-
-object Test {
-
- def main(args: Array[String]): Any = {
- examples.continuations.Test7.main(args)
- }
-
-} \ No newline at end of file
diff --git a/test/pending/continuations-run/example8.scala b/test/pending/continuations-run/example8.scala
deleted file mode 100644
index a5f953d3fc..0000000000
--- a/test/pending/continuations-run/example8.scala
+++ /dev/null
@@ -1,9 +0,0 @@
-// $Id$
-
-object Test {
-
- def main(args: Array[String]): Any = {
- examples.continuations.Test8.main(args)
- }
-
-} \ No newline at end of file
diff --git a/test/pending/continuations-run/example9.scala b/test/pending/continuations-run/example9.scala
deleted file mode 100644
index 09d792c427..0000000000
--- a/test/pending/continuations-run/example9.scala
+++ /dev/null
@@ -1,9 +0,0 @@
-// $Id$
-
-object Test {
-
- def main(args: Array[String]): Any = {
- examples.continuations.Test9Monads.main(args)
- }
-
-} \ No newline at end of file
diff --git a/test/pending/continuations-run/foreach.check b/test/pending/continuations-run/foreach.check
deleted file mode 100644
index 9bab7a2eed..0000000000
--- a/test/pending/continuations-run/foreach.check
+++ /dev/null
@@ -1,4 +0,0 @@
-1
-2
-3
-enough is enough \ No newline at end of file
diff --git a/test/pending/continuations-run/foreach.scala b/test/pending/continuations-run/foreach.scala
deleted file mode 100644
index 76823e7604..0000000000
--- a/test/pending/continuations-run/foreach.scala
+++ /dev/null
@@ -1,33 +0,0 @@
-// $Id$
-
-import scala.util.continuations._
-
-import scala.util.continuations.Loops._
-
-object Test {
-
- def main(args: Array[String]): Any = {
-
-
- reset {
-
- val list = List(1,2,3,4,5)
-
- for (x <- list.suspendable) {
-
- shift { k: (Unit => Unit) =>
- println(x)
- if (x < 3)
- k()
- else
- println("enough is enough")
- }
-
- }
-
- }
-
-
- }
-
-} \ No newline at end of file
diff --git a/test/pending/neg/t2066.scala b/test/pending/neg/t2066.scala
deleted file mode 100644
index 46177b19f7..0000000000
--- a/test/pending/neg/t2066.scala
+++ /dev/null
@@ -1,16 +0,0 @@
-object Test extends App {
- trait A {
- def f[T[_]](x : T[Int]) : T[Any]
- }
-
- class B extends A {
- def f[T[+_]](x : T[Int]) : T[Any] = x
- }
-
- class P[Y](var y : Y)
-
- val p = new P(1)
- val palias = (new B():A).f[P](p)
- palias.y = "hello"
- val z: Int = p.y
-} \ No newline at end of file
diff --git a/test/pending/presentation/context-bounds1.check b/test/pending/presentation/context-bounds1.check
new file mode 100644
index 0000000000..b444de59a4
--- /dev/null
+++ b/test/pending/presentation/context-bounds1.check
@@ -0,0 +1,51 @@
+reload: ContextBounds.scala
+
+askHyperlinkPos for `Blubb` at (2,23) ContextBounds.scala
+================================================================================
+[response] found askHyperlinkPos for `Blubb` at (13,7) ContextBounds.scala
+================================================================================
+
+askHyperlinkPos for `Foo` at (4,17) ContextBounds.scala
+================================================================================
+[response] found askHyperlinkPos for `Foo` at (9,7) ContextBounds.scala
+================================================================================
+
+askHyperlinkPos for `Blubb` at (4,32) ContextBounds.scala
+================================================================================
+[response] found askHyperlinkPos for `Blubb` at (13,7) ContextBounds.scala
+================================================================================
+
+askHyperlinkPos for `A` at (4,42) ContextBounds.scala
+================================================================================
+[response] found askHyperlinkPos for `A` at (4,12) ContextBounds.scala
+================================================================================
+
+askHyperlinkPos for `A` at (4,51) ContextBounds.scala
+================================================================================
+[response] found askHyperlinkPos for `A` at (4,12) ContextBounds.scala
+================================================================================
+
+askHyperlinkPos for `blubb` at (4,66) ContextBounds.scala
+================================================================================
+[response] found askHyperlinkPos for `blubb` at (2,7) ContextBounds.scala
+================================================================================
+
+askHyperlinkPos for `Foo` at (5,18) ContextBounds.scala
+================================================================================
+[response] found askHyperlinkPos for `Foo` at (9,7) ContextBounds.scala
+================================================================================
+
+askHyperlinkPos for `A` at (5,25) ContextBounds.scala
+================================================================================
+[response] found askHyperlinkPos for `A` at (4,12) ContextBounds.scala
+================================================================================
+
+askHyperlinkPos for `foo` at (5,36) ContextBounds.scala
+================================================================================
+[response] found askHyperlinkPos for `foo` at (10,7) ContextBounds.scala
+================================================================================
+
+askHyperlinkPos for `A` at (10,14) ContextBounds.scala
+================================================================================
+[response] found askHyperlinkPos for `A` at (9,11) ContextBounds.scala
+================================================================================
diff --git a/test/pending/presentation/context-bounds1/Test.scala b/test/pending/presentation/context-bounds1/Test.scala
new file mode 100644
index 0000000000..bec1131c4c
--- /dev/null
+++ b/test/pending/presentation/context-bounds1/Test.scala
@@ -0,0 +1,3 @@
+import scala.tools.nsc.interactive.tests.InteractiveTest
+
+object Test extends InteractiveTest \ No newline at end of file
diff --git a/test/pending/presentation/context-bounds1/src/ContextBounds.scala b/test/pending/presentation/context-bounds1/src/ContextBounds.scala
new file mode 100644
index 0000000000..72a8f694a3
--- /dev/null
+++ b/test/pending/presentation/context-bounds1/src/ContextBounds.scala
@@ -0,0 +1,13 @@
+object ContextBound {
+ val blubb = new Blubb/*#*/
+
+ def work[A: Foo/*#*/](f: Blubb/*#*/ => A/*#*/): A/*#*/ = f(blubb/*#*/) ensuring {
+ implicitly[Foo/*#*/[A/*#*/]].foo/*#*/(_) >= 42
+ }
+}
+
+trait Foo[A] {
+ def foo(a: A/*#*/): Int
+}
+
+class Blubb \ No newline at end of file
diff --git a/test/pending/run/idempotency-partial-functions.scala b/test/pending/run/idempotency-partial-functions.scala
index bc0ca706dd..e673da5a29 100644
--- a/test/pending/run/idempotency-partial-functions.scala
+++ b/test/pending/run/idempotency-partial-functions.scala
@@ -20,7 +20,7 @@ object Test extends App {
case e: ToolBoxError => println(e)
}
val tb = cm.mkToolBox()
- val tpartials = tb.typeCheck(partials.tree)
+ val tpartials = tb.typecheck(partials.tree)
println(tpartials)
val rtpartials = tb.resetAllAttrs(tpartials)
println(tb.eval(rtpartials))
diff --git a/test/pending/run/reflection-sync-potpourri.scala b/test/pending/run/reflection-sync-potpourri.scala
new file mode 100644
index 0000000000..0ad5f2ab66
--- /dev/null
+++ b/test/pending/run/reflection-sync-potpourri.scala
@@ -0,0 +1,32 @@
+import scala.reflect.runtime.universe._
+
+// this test checks that under heavily multithreaded conditions:
+// 1) scala.reflect.runtime.universe, its rootMirror and definitions are initialized correctly
+// 2) symbols are correctly materialized into PackageScopes (no dupes)
+// 3) unpickling works okay even we unpickle the same symbol a lot of times
+
+object Test extends App {
+ def foo[T: TypeTag](x: T) = typeOf[T].toString
+ val n = 1000
+ val rng = new scala.util.Random()
+ val types = List(
+ () => typeOf[java.lang.reflect.Method],
+ () => typeOf[java.lang.annotation.Annotation],
+ () => typeOf[scala.io.BufferedSource],
+ () => typeOf[scala.io.Codec])
+ val perms = types.permutations.toList
+ def force(lazytpe: () => Type): String = {
+ lazytpe().typeSymbol.typeSignature
+ lazytpe().toString
+ }
+ val diceRolls = List.fill(n)(rng.nextInt(perms.length))
+ val threads = (1 to n) map (i => new Thread(s"Reflector-$i") {
+ override def run(): Unit = {
+ val s1 = foo("42")
+ val s2 = perms(diceRolls(i - 1)).map(x => force(x)).sorted.mkString(", ")
+ assert(s1 == "java.lang.String")
+ assert(s2 == "java.lang.annotation.Annotation, java.lang.reflect.Method, scala.io.BufferedSource, scala.io.Codec")
+ }
+ })
+ threads foreach (_.start)
+} \ No newline at end of file
diff --git a/test/pending/run/t5943b1.scala b/test/pending/run/t5943b1.scala
index 0d54718753..79c638fedc 100644
--- a/test/pending/run/t5943b1.scala
+++ b/test/pending/run/t5943b1.scala
@@ -6,5 +6,5 @@ import scala.tools.reflect.ToolBox
object Test extends App {
val tb = cm.mkToolBox()
val expr = tb.parse("math.sqrt(4.0)")
- println(tb.typeCheck(expr))
+ println(tb.typecheck(expr))
} \ No newline at end of file