summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPhilipp Haller <hallerp@gmail.com>2009-01-03 15:11:03 +0000
committerPhilipp Haller <hallerp@gmail.com>2009-01-03 15:11:03 +0000
commitb1c9db8bfcd43cb6768c9427dffaf8abc8718489 (patch)
tree16476d7427a3f81758d4fd40c696bd8442902866 /test
parent1805207276e1ef370383735538121610b41934d3 (diff)
downloadscala-b1c9db8bfcd43cb6768c9427dffaf8abc8718489.tar.gz
scala-b1c9db8bfcd43cb6768c9427dffaf8abc8718489.tar.bz2
scala-b1c9db8bfcd43cb6768c9427dffaf8abc8718489.zip
Add tests for zero timeout in reactWithin and r...
Add tests for zero timeout in reactWithin and receiveWithin.
Diffstat (limited to 'test')
-rw-r--r--test/files/jvm/reactWithinZero.check2
-rw-r--r--test/files/jvm/reactWithinZero.scala18
-rw-r--r--test/files/jvm/receiveWithinZero.check2
-rw-r--r--test/files/jvm/receiveWithinZero.scala18
4 files changed, 40 insertions, 0 deletions
diff --git a/test/files/jvm/reactWithinZero.check b/test/files/jvm/reactWithinZero.check
new file mode 100644
index 0000000000..cf2a2facf9
--- /dev/null
+++ b/test/files/jvm/reactWithinZero.check
@@ -0,0 +1,2 @@
+TIMEOUT
+'ack
diff --git a/test/files/jvm/reactWithinZero.scala b/test/files/jvm/reactWithinZero.scala
new file mode 100644
index 0000000000..0786ce271d
--- /dev/null
+++ b/test/files/jvm/reactWithinZero.scala
@@ -0,0 +1,18 @@
+import scala.actors.{Actor, TIMEOUT}
+
+class A extends Actor {
+ def act() = reactWithin(0) {
+ case TIMEOUT =>
+ println("TIMEOUT")
+ reply('ack)
+ act()
+ case x => println(x)
+ }
+}
+
+object Test {
+ def main(args: Array[String]): Unit = {
+ val a = new A
+ a.start()
+ }
+}
diff --git a/test/files/jvm/receiveWithinZero.check b/test/files/jvm/receiveWithinZero.check
new file mode 100644
index 0000000000..cf2a2facf9
--- /dev/null
+++ b/test/files/jvm/receiveWithinZero.check
@@ -0,0 +1,2 @@
+TIMEOUT
+'ack
diff --git a/test/files/jvm/receiveWithinZero.scala b/test/files/jvm/receiveWithinZero.scala
new file mode 100644
index 0000000000..315dd9c86a
--- /dev/null
+++ b/test/files/jvm/receiveWithinZero.scala
@@ -0,0 +1,18 @@
+import scala.actors.{Actor, TIMEOUT}
+
+class A extends Actor {
+ def act() = receiveWithin(0) {
+ case TIMEOUT =>
+ println("TIMEOUT")
+ reply('ack)
+ act()
+ case x => println(x)
+ }
+}
+
+object Test {
+ def main(args: Array[String]): Unit = {
+ val a = new A
+ a.start()
+ }
+}