aboutsummaryrefslogtreecommitdiff
path: root/src/test/scala/scala/async/run/exceptions/ExceptionsSpec.scala
diff options
context:
space:
mode:
authorNthPortal <nthportal@gmail.com>2018-02-21 22:24:51 -0500
committerNthPortal <nthportal@gmail.com>2018-02-27 00:08:53 -0500
commit58e7e33ea3d0b2841c610fdf218da0d0fcc53f3a (patch)
treeffc65617f3a92c7bd251b5f441de4e598d52038b /src/test/scala/scala/async/run/exceptions/ExceptionsSpec.scala
parente5cde43baaf34b5479314b7a0904a95a255d3846 (diff)
downloadscala-async-58e7e33ea3d0b2841c610fdf218da0d0fcc53f3a.tar.gz
scala-async-58e7e33ea3d0b2841c610fdf218da0d0fcc53f3a.tar.bz2
scala-async-58e7e33ea3d0b2841c610fdf218da0d0fcc53f3a.zip
Remove uses of deprecated Future APIs
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) }