summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorIulian Dragos <jaguarul@gmail.com>2012-09-04 10:50:21 +0200
committerIulian Dragos <jaguarul@gmail.com>2012-09-05 15:23:30 +0200
commitf2caa7717eb991f9973ec68d47c1cd969db6ea23 (patch)
tree7e016e15a8703b6449cffe913ec0a04e09a7f324 /test
parent0054b6c4677387de712b2612c00bd261f5df0b2d (diff)
downloadscala-f2caa7717eb991f9973ec68d47c1cd969db6ea23.tar.gz
scala-f2caa7717eb991f9973ec68d47c1cd969db6ea23.tar.bz2
scala-f2caa7717eb991f9973ec68d47c1cd969db6ea23.zip
Allow nested calls to `askForResponse` in the presentation compiler.
Fix #6312. review by @odersky,@lrytz.(cherry picked from commit 4f932df552fd2a9e1af31bc3b5fbbfeeaa15feed)
Diffstat (limited to 'test')
-rw-r--r--test/files/presentation/recursive-ask.check4
-rw-r--r--test/files/presentation/recursive-ask/RecursiveAsk.scala20
2 files changed, 24 insertions, 0 deletions
diff --git a/test/files/presentation/recursive-ask.check b/test/files/presentation/recursive-ask.check
new file mode 100644
index 0000000000..357d2cf879
--- /dev/null
+++ b/test/files/presentation/recursive-ask.check
@@ -0,0 +1,4 @@
+[ outer] askForResponse
+[nested] askForResponse
+passed
+done
diff --git a/test/files/presentation/recursive-ask/RecursiveAsk.scala b/test/files/presentation/recursive-ask/RecursiveAsk.scala
new file mode 100644
index 0000000000..c59d6968a4
--- /dev/null
+++ b/test/files/presentation/recursive-ask/RecursiveAsk.scala
@@ -0,0 +1,20 @@
+import scala.tools.nsc.interactive.tests._
+
+object Test extends InteractiveTest {
+
+ override def main(args: Array[String]): Unit = {
+ val res0 = compiler.askForResponse( () => {
+ println("[ outer] askForResponse")
+ val res = compiler.askForResponse( () => { println("[nested] askForResponse") })
+ println (res.get(5000) match {
+ case Some(_) => "passed"
+ case None => "timeout"
+ })
+ })
+
+ res0.get(5000)
+
+ println("done")
+ compiler.askShutdown()
+ }
+}