From 61b3dec7329ebd5d998b18f8474e3301945261ba Mon Sep 17 00:00:00 2001 From: Viktor Klang Date: Tue, 17 Jul 2012 17:39:24 +0200 Subject: [PATCH] Making so that 'pass checks' fails --- .../src/test/scala/akka/dispatch/FutureSpec.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/akka-actor-tests/src/test/scala/akka/dispatch/FutureSpec.scala b/akka-actor-tests/src/test/scala/akka/dispatch/FutureSpec.scala index 3556ee914f..7373eafc93 100644 --- a/akka-actor-tests/src/test/scala/akka/dispatch/FutureSpec.scala +++ b/akka-actor-tests/src/test/scala/akka/dispatch/FutureSpec.scala @@ -146,7 +146,7 @@ class FutureSpec extends AkkaSpec with Checkers with BeforeAndAfterAll with Defa "pass checks" in { filterException[ArithmeticException] { check({ (future: Future[Int], actions: List[FutureAction]) ⇒ - def wrap[T](f: Future[T]): Either[Throwable, T] = try Await.ready(f, timeout.duration).value.get catch { case t ⇒ println(f.getClass + " - " + t.getClass + ": " + t.getMessage + ""); f.value.get } + def wrap[T](f: Future[T]): Either[Throwable, T] = Await.ready(f, timeout.duration).value.get val result = (future /: actions)(_ /: _) val expected = (wrap(future) /: actions)(_ /: _) ((wrap(result), expected) match { @@ -996,7 +996,7 @@ class FutureSpec extends AkkaSpec with Checkers with BeforeAndAfterAll with Defa case Left(e) ⇒ that case Right(r) ⇒ try { Right(action(r)) } catch { case e if NonFatal(e) ⇒ Left(e) } } - def /:(that: Future[Int]): Future[Int] = that flatMap (n ⇒ Future(action(n))) + def /:(that: Future[Int]): Future[Int] = that flatMap (n ⇒ Future.successful(action(n))) } implicit def arbFuture: Arbitrary[Future[Int]] = Arbitrary(for (n ← arbitrary[Int]) yield Future(n))