aboutsummaryrefslogtreecommitdiff
path: root/tests/pending/pos
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-12-19 15:21:34 +0100
committerMartin Odersky <odersky@gmail.com>2014-12-19 15:21:34 +0100
commit63c582b39ba8a248c9d6ad23db2224ea4a809a58 (patch)
treed953fd9c0b8b8e7c6f22158e27dff9db8944d745 /tests/pending/pos
parent73d008317a6afaa0fea103ec0c84a39386f7d776 (diff)
downloaddotty-63c582b39ba8a248c9d6ad23db2224ea4a809a58.tar.gz
dotty-63c582b39ba8a248c9d6ad23db2224ea4a809a58.tar.bz2
dotty-63c582b39ba8a248c9d6ad23db2224ea4a809a58.zip
Test re-org.
Moved some working test to pos. I wonder why they were in pending? They did work for me.
Diffstat (limited to 'tests/pending/pos')
-rw-r--r--tests/pending/pos/CustomGlobal.scala33
-rw-r--r--tests/pending/pos/List1.scala45
-rw-r--r--tests/pending/pos/MailBox.scala84
3 files changed, 0 insertions, 162 deletions
diff --git a/tests/pending/pos/CustomGlobal.scala b/tests/pending/pos/CustomGlobal.scala
deleted file mode 100644
index a5668bd7c..000000000
--- a/tests/pending/pos/CustomGlobal.scala
+++ /dev/null
@@ -1,33 +0,0 @@
-package custom
-
-import scala.tools.nsc._, reporters._, typechecker._
-
-/** Demonstration of a custom Global with a custom Typer,
- * decoupled from trunk. Demonstration:
- *
-{{{
-scalac -d . CustomGlobal.scala && scala -nc -Yglobal-class custom.CustomGlobal \
- -e 'class Bippy(x: Int) ; def f = new Bippy(5)'
-
-I'm typing a Bippy! It's a ClassDef.
-I'm typing a Bippy! It's a Ident.
-I'm typing a Bippy! It's a DefDef.
-}}}
- *
- */
-class CustomGlobal(currentSettings: Settings, reporter: Reporter) extends Global(currentSettings, reporter) {
- override lazy val analyzer = new {
- val global: CustomGlobal.this.type = CustomGlobal.this
- } with Analyzer {
- override def newTyper(context: Context): Typer = new CustomTyper(context)
-
- class CustomTyper(context : Context) extends Typer(context) {
- override def typed(tree: Tree, mode: Mode, pt: Type): Tree = {
- if (tree.summaryString contains "Bippy")
- println("I'm typing a Bippy! It's a " + tree.shortClass + ".")
-
- super.typed(tree, mode, pt)
- }
- }
- }
-}
diff --git a/tests/pending/pos/List1.scala b/tests/pending/pos/List1.scala
deleted file mode 100644
index 30ebf5e1e..000000000
--- a/tests/pending/pos/List1.scala
+++ /dev/null
@@ -1,45 +0,0 @@
-object lists {
-
- abstract class List[a] {
- def isEmpty: Boolean;
- def head: a;
- def tail: List[a];
- def prepend(x: a) = Cons[a](x, this);
- }
-
- def Nil[b] = new List[b] {
- def isEmpty: Boolean = true;
- def head = sys.error("head of Nil");
- def tail = sys.error("tail of Nil");
- }
-
- def Cons[c](x: c, xs: List[c]): List[c] = new List[c] {
- def isEmpty = false;
- def head = x;
- def tail = xs;
- }
-
- def foo = {
- val intnil = Nil[Int];
- val intlist = intnil.prepend(1).prepend(1+1);
- val x: Int = intlist.head;
- val strnil = Nil[String];
- val strlist = strnil.prepend("A").prepend("AA");
- val y: String = strlist.head;
- ()
- }
-
- class IntList() extends List[Int] {
- def isEmpty: Boolean = false;
- def head: Int = 1;
- def foo: List[Int] { def isEmpty: Boolean; def head: Int; def tail: List[Int] } = Nil[Int];
- def tail0: List[Int] = foo.prepend(1).prepend(1+1);
- def tail: List[Int] = Nil[Int].prepend(1).prepend(1+1);
- }
-
- def foo2 = {
- val il1 = new IntList();
- val il2 = il1.prepend(1).prepend(2);
- ()
- }
-}
diff --git a/tests/pending/pos/MailBox.scala b/tests/pending/pos/MailBox.scala
deleted file mode 100644
index 8e27bd362..000000000
--- a/tests/pending/pos/MailBox.scala
+++ /dev/null
@@ -1,84 +0,0 @@
-package test;
-
-import scala.actors.TIMEOUT;
-
-class MailBox {
-
- private class LinkedList[a] {
- var elem: a = _;
- var next: LinkedList[a] = null;
- }
-
- private def insert[a](l: LinkedList[a], x: a): LinkedList[a] = {
- l.next = new LinkedList[a];
- l.next.elem = x;
- l.next.next = l.next;
- l
- }
-
- private abstract class Receiver {
- def isDefined(msg: Any): Boolean;
- var msg: Any = null;
- }
-
- private val sent = new LinkedList[Any];
- private var lastSent = sent;
- private val receivers = new LinkedList[Receiver];
- private var lastReceiver = receivers;
-
- def send(msg: Any): Unit = synchronized {
- var r = receivers;
- var r1 = r.next;
- while (r1 != null && !r1.elem.isDefined(msg)) {
- r = r1; r1 = r1.next;
- }
- if (r1 != null) {
- r.next = r1.next; r1.elem.msg = msg; r1.elem.notify();
- } else {
- lastSent = insert(lastSent, msg);
- }
- }
-
- def receive[a](f: PartialFunction[Any, a]): a = {
- val msg: Any = synchronized {
- var s = sent;
- var s1 = s.next;
- while (s1 != null && !f.isDefinedAt(s1.elem)) {
- s = s1; s1 = s1.next
- }
- if (s1 != null) {
- s.next = s1.next; s1.elem
- } else {
- val r = insert(lastReceiver, new Receiver {
- def isDefined(msg: Any) = f.isDefinedAt(msg);
- });
- lastReceiver = r;
- r.elem.wait();
- r.elem.msg
- }
- }
- f(msg)
- }
-
- def receiveWithin[a](msec: Long)(f: PartialFunction[Any, a]): a = {
- val msg: Any = synchronized {
- var s = sent;
- var s1 = s.next;
- while (s1 != null && !f.isDefinedAt(s1.elem)) {
- s = s1; s1 = s1.next ;
- }
- if (s1 != null) {
- s.next = s1.next; s1.elem
- } else {
- val r = insert(lastReceiver, new Receiver {
- def isDefined(msg: Any) = f.isDefinedAt(msg);
- });
- lastReceiver = r;
- r.elem.wait(msec);
- if (r.elem.msg == null) r.elem.msg = TIMEOUT;
- r.elem.msg
- }
- }
- f(msg)
- }
-}