diff options
author | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2015-09-14 17:07:23 +0200 |
---|---|---|
committer | Dmitry Petrashko <dmitry.petrashko@gmail.com> | 2015-09-14 17:07:23 +0200 |
commit | 12053fa4d55497fc4df06afd67ba3762019969c3 (patch) | |
tree | 0cbab1dee0784793d2ab09124a0103412e813072 /tests/pending/run/future-flatmap-exec-count.scala | |
parent | 91f992c8af3e61a76bd862ad43b9abef9a6c3403 (diff) | |
download | dotty-12053fa4d55497fc4df06afd67ba3762019969c3.tar.gz dotty-12053fa4d55497fc4df06afd67ba3762019969c3.tar.bz2 dotty-12053fa4d55497fc4df06afd67ba3762019969c3.zip |
Enable more tests that pass
Diffstat (limited to 'tests/pending/run/future-flatmap-exec-count.scala')
-rw-r--r-- | tests/pending/run/future-flatmap-exec-count.scala | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/tests/pending/run/future-flatmap-exec-count.scala b/tests/pending/run/future-flatmap-exec-count.scala deleted file mode 100644 index 849beb6b1..000000000 --- a/tests/pending/run/future-flatmap-exec-count.scala +++ /dev/null @@ -1,61 +0,0 @@ -import scala.concurrent._ -import java.util.concurrent.atomic.AtomicInteger - -object Test { - def main(args: Array[String]): Unit = { - test() - } - - def test() = { - def await(f: Future[Any]) = - Await.result(f, duration.Duration.Inf) - - val ec = new TestExecutionContext(ExecutionContext.Implicits.global) - - { - val p = Promise[Int]() - val fp = p.future - println("mapping") - val mapped = fp.map(x => x)(ec) - p.success(0) - await(mapped) - } - - { - println("flatmapping") - val p = Promise[Int]() - val fp = p.future - val flatMapped = fp.flatMap({ (x: Int) => - Future.successful(2 * x) - })(ec) - p.success(0) - await(flatMapped) - } - - { - println("recovering") - val recovered = Future.failed(new Throwable()).recoverWith { - case _ => Future.successful(2) - }(ec) - await(recovered) - } - } - - class TestExecutionContext(delegate: ExecutionContext) extends ExecutionContext { - def execute(runnable: Runnable): Unit = ??? - - def reportFailure(t: Throwable): Unit = ??? - - override def prepare(): ExecutionContext = { - val preparedDelegate = delegate.prepare() - return new ExecutionContext { - def execute(runnable: Runnable): Unit = { - println("execute()") - preparedDelegate.execute(runnable) - } - - def reportFailure(t: Throwable): Unit = ??? - } - } - } -} |