summaryrefslogtreecommitdiff
path: root/test/partest-tests/jvm
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2010-04-12 21:36:33 +0000
committerPaul Phillips <paulp@improving.org>2010-04-12 21:36:33 +0000
commit7015c96b21d4d5ae7f5bdd9f921bbf0aeef9856c (patch)
tree102023fb372eff8ae726320f7108fe2f3071f5f2 /test/partest-tests/jvm
parentbeee01e9ec6c650a7ebf17489f97896f6d3d119f (diff)
downloadscala-7015c96b21d4d5ae7f5bdd9f921bbf0aeef9856c.tar.gz
scala-7015c96b21d4d5ae7f5bdd9f921bbf0aeef9856c.tar.bz2
scala-7015c96b21d4d5ae7f5bdd9f921bbf0aeef9856c.zip
Still working on partest.
temporary if considered clutter. ant test.partest ant test.partest-opt They run some recently troublesome partest tests with a low timeout. Logged some more exceptions where the compiler has been dying. Review by phaller.
Diffstat (limited to 'test/partest-tests/jvm')
-rw-r--r--test/partest-tests/jvm/actor-receivewithin.check16
-rw-r--r--test/partest-tests/jvm/actor-receivewithin.scala69
2 files changed, 85 insertions, 0 deletions
diff --git a/test/partest-tests/jvm/actor-receivewithin.check b/test/partest-tests/jvm/actor-receivewithin.check
new file mode 100644
index 0000000000..a6a3e88c61
--- /dev/null
+++ b/test/partest-tests/jvm/actor-receivewithin.check
@@ -0,0 +1,16 @@
+'msg
+'msg
+'msg
+'msg
+'msg
+TIMEOUT
+TIMEOUT
+TIMEOUT
+TIMEOUT
+TIMEOUT
+'msg2
+'msg2
+'msg2
+'msg2
+'msg2
+TIMEOUT
diff --git a/test/partest-tests/jvm/actor-receivewithin.scala b/test/partest-tests/jvm/actor-receivewithin.scala
new file mode 100644
index 0000000000..a5c87c2722
--- /dev/null
+++ b/test/partest-tests/jvm/actor-receivewithin.scala
@@ -0,0 +1,69 @@
+import scala.actors.{Actor, TIMEOUT}
+
+object A extends Actor {
+ def act() {
+ receive {
+ case 'done =>
+ var cnt = 0
+ while (cnt < 500) {
+ cnt += 1
+ receiveWithin (0) {
+ case 'msg =>
+ if (cnt % 100 == 0)
+ println("'msg")
+ case TIMEOUT =>
+ // should not happen
+ println("FAIL1")
+ }
+ }
+ cnt = 0
+ while (cnt < 500) {
+ cnt += 1
+ receiveWithin (0) {
+ case 'msg =>
+ // should not happen
+ println("FAIL2")
+ case TIMEOUT =>
+ if (cnt % 100 == 0)
+ println("TIMEOUT")
+ }
+ }
+ B ! 'next
+ receive { case 'done => }
+ cnt = 0
+ while (cnt < 501) {
+ cnt += 1
+ receiveWithin (500) {
+ case 'msg2 =>
+ if (cnt % 100 == 0)
+ println("'msg2")
+ case TIMEOUT =>
+ println("TIMEOUT")
+ }
+ }
+ }
+ }
+}
+
+object B extends Actor {
+ def act() {
+ A.start()
+ for (_ <- 1 to 500) {
+ A ! 'msg
+ }
+ A ! 'done
+ receive {
+ case 'next =>
+ for (_ <- 1 to 500) {
+ A ! 'msg2
+ }
+ A ! 'done
+ }
+ }
+}
+
+object Test {
+ def main(args:Array[String]) {
+ B.start()
+ }
+}