diff options
author | Philipp Haller <hallerp@gmail.com> | 2009-05-27 15:59:21 +0000 |
---|---|---|
committer | Philipp Haller <hallerp@gmail.com> | 2009-05-27 15:59:21 +0000 |
commit | b22342e78a3134d186f82dac5e1c7be01ece7c17 (patch) | |
tree | d08e38c518de125e4e41021913fea3313b78964c /test/files/jvm/future-termination.scala | |
parent | 29f58824a4afa0208ec45c57b1d999b132cfddf0 (diff) | |
download | scala-b22342e78a3134d186f82dac5e1c7be01ece7c17.tar.gz scala-b22342e78a3134d186f82dac5e1c7be01ece7c17.tar.bz2 scala-b22342e78a3134d186f82dac5e1c7be01ece7c17.zip |
Added tests for #2015.
Diffstat (limited to 'test/files/jvm/future-termination.scala')
-rw-r--r-- | test/files/jvm/future-termination.scala | 14 |
1 files changed, 14 insertions, 0 deletions
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.") + } +} |