From b22342e78a3134d186f82dac5e1c7be01ece7c17 Mon Sep 17 00:00:00 2001 From: Philipp Haller Date: Wed, 27 May 2009 15:59:21 +0000 Subject: Added tests for #2015. --- test/files/jvm/future-termination.scala | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 test/files/jvm/future-termination.scala (limited to 'test/files/jvm/future-termination.scala') diff --git a/test/files/jvm/future-termination.scala b/test/files/jvm/future-termination.scala new file mode 100644 index 0000000000..c448a88aa7 --- /dev/null +++ b/test/files/jvm/future-termination.scala @@ -0,0 +1,14 @@ +import scala.actors.Futures + +/* Test that unevaluated futures do not prevent program termination */ + +object Test { + def main(args: Array[String]) { + val meaningOfLife = Futures.future { + Thread.sleep(5000) // pretend this is a harder problem than it is + println("I have the answer!") + 42 + } + println("I can't wait that long, bye.") + } +} -- cgit v1.2.3