aboutsummaryrefslogtreecommitdiff
path: root/src/test/scala/scala/async/run/exceptions/ExceptionsSpec.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/scala/scala/async/run/exceptions/ExceptionsSpec.scala')
-rw-r--r--src/test/scala/scala/async/run/exceptions/ExceptionsSpec.scala12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/test/scala/scala/async/run/exceptions/ExceptionsSpec.scala b/src/test/scala/scala/async/run/exceptions/ExceptionsSpec.scala
index d66c5ed..649543f 100644
--- a/src/test/scala/scala/async/run/exceptions/ExceptionsSpec.scala
+++ b/src/test/scala/scala/async/run/exceptions/ExceptionsSpec.scala
@@ -8,7 +8,7 @@ package exceptions
import scala.async.Async.{async, await}
-import scala.concurrent.{future, ExecutionContext, Await}
+import scala.concurrent.{Future, ExecutionContext, Await}
import ExecutionContext.Implicits._
import scala.concurrent.duration._
import scala.reflect.ClassTag
@@ -25,7 +25,7 @@ class ExceptionsSpec {
@Test
def `uncaught exception within async after await`() {
- val base = future { "five!".length }
+ val base = Future { "five!".length }
val fut = async {
val len = await(base)
throw new Exception(s"illegal length: $len")
@@ -35,7 +35,7 @@ class ExceptionsSpec {
@Test
def `await failing future within async`() {
- val base = future[Int] { throw new Exception("problem") }
+ val base = Future[Int] { throw new Exception("problem") }
val fut = async {
val x = await(base)
x * 2
@@ -45,11 +45,11 @@ class ExceptionsSpec {
@Test
def `await failing future within async after await`() {
- val base = future[Any] { "five!".length }
+ val base = Future[Any] { "five!".length }
val fut = async {
val a = await(base.mapTo[Int]) // result: 5
- val b = await((future { (a * 2).toString }).mapTo[Int]) // result: ClassCastException
- val c = await(future { (7 * 2).toString }) // result: "14"
+ val b = await((Future { (a * 2).toString }).mapTo[Int]) // result: ClassCastException
+ val c = await(Future { (7 * 2).toString }) // result: "14"
b + "-" + c
}
intercept[ClassCastException] { Await.result(fut, 2.seconds) }