aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2012-11-09 18:41:16 +0100
committerJason Zaugg <jzaugg@gmail.com>2012-11-09 18:41:16 +0100
commit23209e2f10a123aa7ccd512454cd18ace81a2476 (patch)
treecf1a3c97b3a7217a598ca686a4804e9a67eb2c94
parent6226c3583b742e0576e5c598fba4e64622c99165 (diff)
downloadscala-async-23209e2f10a123aa7ccd512454cd18ace81a2476.tar.gz
scala-async-23209e2f10a123aa7ccd512454cd18ace81a2476.tar.bz2
scala-async-23209e2f10a123aa7ccd512454cd18ace81a2476.zip
Test with less trivial types.
Works like it says on the box.
-rw-r--r--src/test/scala/scala/async/run/toughtype/ToughType.scala39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/test/scala/scala/async/run/toughtype/ToughType.scala b/src/test/scala/scala/async/run/toughtype/ToughType.scala
new file mode 100644
index 0000000..f576ddc
--- /dev/null
+++ b/src/test/scala/scala/async/run/toughtype/ToughType.scala
@@ -0,0 +1,39 @@
+/**
+ * Copyright (C) 2012 Typesafe Inc. <http://www.typesafe.com>
+ */
+
+package scala.async
+package run
+package toughtype
+
+import language.{reflectiveCalls, postfixOps}
+import scala.concurrent._
+import scala.concurrent.duration._
+import scala.async.Async._
+import org.junit.Test
+import org.junit.runner.RunWith
+import org.junit.runners.JUnit4
+
+
+object ToughTypeObject {
+
+ import ExecutionContext.Implicits.global
+
+ class Inner
+
+ def m2 = async[(List[_], ToughTypeObject.Inner)] {
+ val y = await(future[List[_]](Nil))
+ val z = await(future[Inner](new Inner))
+ (y, z)
+ }
+}
+
+@RunWith(classOf[JUnit4])
+class ToughTypeSpec {
+
+ @Test def `propogates tough types`() {
+ val fut = ToughTypeObject.m2
+ val res: (List[_], scala.async.run.toughtype.ToughTypeObject.Inner) = Await.result(fut, 2 seconds)
+ res._1 mustBe (Nil)
+ }
+}