diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2012-11-05 16:37:34 +0100 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2012-11-05 16:37:34 +0100 |
commit | ec1c805c533929e6f78471bc265e3933e0f34c90 (patch) | |
tree | 53d0ea898a6028c04f9bb233a1250c6047b3b3b5 /test | |
parent | ebdc017f9506192e985ef91905c6f7e08be6d6fb (diff) | |
download | scala-async-ec1c805c533929e6f78471bc265e3933e0f34c90.tar.gz scala-async-ec1c805c533929e6f78471bc265e3933e0f34c90.tar.bz2 scala-async-ec1c805c533929e6f78471bc265e3933e0f34c90.zip |
Further (re-)moving files.
Diffstat (limited to 'test')
-rw-r--r-- | test/files/codelib/code.jar | bin | 683 -> 0 bytes | |||
-rw-r--r-- | test/files/lib/forkjoin.jar | bin | 51464 -> 0 bytes | |||
-rw-r--r-- | test/files/lib/scalacheck.jar | bin | 763570 -> 0 bytes | |||
-rw-r--r-- | test/pending/run/fallback0/MinimalScalaTest.scala | 0 | ||||
-rw-r--r-- | test/pending/run/fallback0/fallback0-manual.scala | 72 | ||||
-rw-r--r-- | test/pending/run/fallback0/fallback0.scala | 49 |
6 files changed, 0 insertions, 121 deletions
diff --git a/test/files/codelib/code.jar b/test/files/codelib/code.jar Binary files differdeleted file mode 100644 index 1752c0e..0000000 --- a/test/files/codelib/code.jar +++ /dev/null diff --git a/test/files/lib/forkjoin.jar b/test/files/lib/forkjoin.jar Binary files differdeleted file mode 100644 index ead9bbd..0000000 --- a/test/files/lib/forkjoin.jar +++ /dev/null diff --git a/test/files/lib/scalacheck.jar b/test/files/lib/scalacheck.jar Binary files differdeleted file mode 100644 index 41c89ad..0000000 --- a/test/files/lib/scalacheck.jar +++ /dev/null diff --git a/test/pending/run/fallback0/MinimalScalaTest.scala b/test/pending/run/fallback0/MinimalScalaTest.scala deleted file mode 100644 index e69de29..0000000 --- a/test/pending/run/fallback0/MinimalScalaTest.scala +++ /dev/null diff --git a/test/pending/run/fallback0/fallback0-manual.scala b/test/pending/run/fallback0/fallback0-manual.scala deleted file mode 100644 index 611d09d..0000000 --- a/test/pending/run/fallback0/fallback0-manual.scala +++ /dev/null @@ -1,72 +0,0 @@ -/** - * Copyright (C) 2012 Typesafe Inc. <http://www.typesafe.com> - */ - -import language.{ reflectiveCalls, postfixOps } -import scala.concurrent.{ Future, ExecutionContext, future, Await, Promise } -import scala.concurrent.duration._ -import scala.async.EndTaskException -import scala.async.Async.{ async, await, awaitCps } -import scala.util.continuations.reset - -object TestManual extends App { - - Fallback0ManualSpec.check() - -} - -class TestFallback0ManualClass { - import ExecutionContext.Implicits.global - - def m1(x: Int): Future[Int] = future { - Thread.sleep(1000) - x + 2 - } - - def m2(y: Int): Future[Int] = { - val p = Promise[Int]() - future { reset { - val f = m1(y) - var z = 0 - val res = awaitCps(f, p) + 5 - if (res > 0) { - z = 2 - } else { - z = 4 - } - z - } } - p.future - } - - /* that isn't even supported by current CPS plugin - def m3(y: Int): Future[Int] = { - val p = Promise[Int]() - future { reset { - val f = m1(y) - var z = 0 - val res: Option[Int] = Some(5) - res match { - case None => z = 4 - case Some(a) => z = awaitCps(f, p) - 10 - } - z - } } - p.future - } - */ -} - - -object Fallback0ManualSpec extends MinimalScalaTest { - - "An async method" should { - "support await in a simple if-else expression" in { - val o = new TestFallback0ManualClass - val fut = o.m2(10) - val res = Await.result(fut, 2 seconds) - res mustBe(2) - } - } - -} diff --git a/test/pending/run/fallback0/fallback0.scala b/test/pending/run/fallback0/fallback0.scala deleted file mode 100644 index 75b0739..0000000 --- a/test/pending/run/fallback0/fallback0.scala +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Copyright (C) 2012 Typesafe Inc. <http://www.typesafe.com> - */ - -import language.{ reflectiveCalls, postfixOps } -import scala.concurrent.{ Future, ExecutionContext, future, Await } -import scala.concurrent.duration._ -import scala.async.Async.{ async, await, awaitCps } - -object Test extends App { - - Fallback0Spec.check() - -} - -class TestFallback0Class { - import ExecutionContext.Implicits.global - - def m1(x: Int): Future[Int] = future { - Thread.sleep(1000) - x + 2 - } - - def m2(y: Int): Future[Int] = async { - val f = m1(y) - var z = 0 - val res = await(f) + 5 - if (res > 0) { - z = 2 - } else { - z = 4 - } - z - } -} - - -object Fallback0Spec extends MinimalScalaTest { - - "An async method" should { - "support await in a simple if-else expression" in { - val o = new TestFallback0Class - val fut = o.m2(10) - val res = Await.result(fut, 2 seconds) - res mustBe(2) - } - } - -} |