diff options
Diffstat (limited to 'test/files/jvm/future-spec')
-rw-r--r-- | test/files/jvm/future-spec/TryTests.scala | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/test/files/jvm/future-spec/TryTests.scala b/test/files/jvm/future-spec/TryTests.scala index 82ca12276f..5d1b9b84b4 100644 --- a/test/files/jvm/future-spec/TryTests.scala +++ b/test/files/jvm/future-spec/TryTests.scala @@ -46,6 +46,12 @@ object TryTests extends MinimalScalaTest { val e2 = new Exception Failure[Int](e) map(_ => throw e2) mustEqual Failure(e) } + "when there is a fatal exception" in { + val e3 = new ThreadDeath + intercept[ThreadDeath] { + Success(1) map (_ => throw e3) + } + } } "flatMap" in { @@ -60,6 +66,12 @@ object TryTests extends MinimalScalaTest { val e2 = new Exception Failure[Int](e).flatMap[Int](_ => throw e2) mustEqual Failure(e) } + "when there is a fatal exception" in { + val e3 = new ThreadDeath + intercept[ThreadDeath] { + Success(1).flatMap[Int](_ => throw e3) + } + } } "flatten" in { @@ -115,4 +127,4 @@ object TryTests extends MinimalScalaTest { } } } -}
\ No newline at end of file +} |