diff options
Diffstat (limited to 'test/files/jvm')
-rw-r--r-- | test/files/jvm/future-spec/FutureTests.scala | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/test/files/jvm/future-spec/FutureTests.scala b/test/files/jvm/future-spec/FutureTests.scala index 8674be168c..0efa83fbd9 100644 --- a/test/files/jvm/future-spec/FutureTests.scala +++ b/test/files/jvm/future-spec/FutureTests.scala @@ -70,7 +70,19 @@ object FutureTests extends MinimalScalaTest { //FIXME should check } } - + + "The default ExecutionContext" should { + "report uncaught exceptions" in { + val p = Promise[Throwable]() + val logThrowable: Throwable => Unit = p.trySuccess(_) + val ec: ExecutionContext = ExecutionContext.fromExecutor(null, logThrowable) + + val t = new NotImplementedError("foo") + val f = Future(throw t)(ec) + Await.result(p.future, 2.seconds) mustBe t + } + } + "A future with global ExecutionContext" should { import ExecutionContext.Implicits._ |