summaryrefslogtreecommitdiff
path: root/test/files/jvm/replyreactor-react-sender.scala
diff options
context:
space:
mode:
authorPhilipp Haller <hallerp@gmail.com>2009-10-26 21:01:12 +0000
committerPhilipp Haller <hallerp@gmail.com>2009-10-26 21:01:12 +0000
commitf3068614fb38fc08be54ac1179a1cfec52b8b13b (patch)
tree76ee219f209559d900b17682e29c9aaf9b3d73ab /test/files/jvm/replyreactor-react-sender.scala
parent63b1fd9be6c8c9e28092d775037c695af4b264e3 (diff)
downloadscala-f3068614fb38fc08be54ac1179a1cfec52b8b13b.tar.gz
scala-f3068614fb38fc08be54ac1179a1cfec52b8b13b.tar.bz2
scala-f3068614fb38fc08be54ac1179a1cfec52b8b13b.zip
Second half of fix and tests for #1518.
Diffstat (limited to 'test/files/jvm/replyreactor-react-sender.scala')
-rw-r--r--test/files/jvm/replyreactor-react-sender.scala41
1 files changed, 41 insertions, 0 deletions
diff --git a/test/files/jvm/replyreactor-react-sender.scala b/test/files/jvm/replyreactor-react-sender.scala
new file mode 100644
index 0000000000..1127dfd0a5
--- /dev/null
+++ b/test/files/jvm/replyreactor-react-sender.scala
@@ -0,0 +1,41 @@
+import scala.actors.ReplyReactor
+import scala.actors.Actor._
+
+object Test {
+
+ val NUM = 2000
+
+ def main(args: Array[String]) {
+ var b: ReplyReactor = null
+
+ val a = new ReplyReactor {
+ def act() {
+ var i = 0
+ loopWhile (i < NUM) {
+ i += 1
+ react {
+ case 'hello if sender == this => b ! 'fail
+ case 'hello if sender == b => // do nothing
+ }
+ } andThen {
+ b ! 'ok
+ }
+ }
+ }
+ a.start()
+
+ b = new ReplyReactor {
+ def act() {
+ for (_ <- 0 until NUM)
+ a ! 'hello
+ react {
+ case 'fail => println("FAIL")
+ case 'ok => println("OK")
+ case other => println(other)
+ }
+ }
+ }
+ b.start()
+ }
+
+}