From 58e7e33ea3d0b2841c610fdf218da0d0fcc53f3a Mon Sep 17 00:00:00 2001 From: NthPortal Date: Wed, 21 Feb 2018 22:24:51 -0500 Subject: Remove uses of deprecated Future APIs --- .../scala/scala/async/run/exceptions/ExceptionsSpec.scala | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/test/scala/scala/async/run/exceptions/ExceptionsSpec.scala') 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) } -- cgit v1.2.3