aboutsummaryrefslogtreecommitdiff
path: root/src/test/scala/scala/async/run/match0/Match0.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/scala/scala/async/run/match0/Match0.scala')
-rw-r--r--src/test/scala/scala/async/run/match0/Match0.scala12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/scala/scala/async/run/match0/Match0.scala b/src/test/scala/scala/async/run/match0/Match0.scala
index 5237629..8263e72 100644
--- a/src/test/scala/scala/async/run/match0/Match0.scala
+++ b/src/test/scala/scala/async/run/match0/Match0.scala
@@ -100,4 +100,16 @@ class MatchSpec {
}
result mustBe ((Some(""), true))
}
+
+ @Test def `await in scrutinee`() {
+ import AsyncId.{async, await}
+ val result = async {
+ await(if ("".isEmpty) await(1) else ???) match {
+ case x if x < 0 => ???
+ case y: Int => y * await(3)
+ case _ => ???
+ }
+ }
+ result mustBe (3)
+ }
}