Skip to content

Commit 19bfe3e

Browse files
committed
Add a test for Return
1 parent 722fd3d commit 19bfe3e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

keywords-Await/src/test/scala/com/thoughtworks/dsl/keywords/AwaitTest.scala

+12
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,18 @@ import scala.language.dynamics
1515
import org.hamcrest.CoreMatchers.instanceOf
1616

1717
class AwaitTest {
18+
19+
@Test
20+
def testReturnIf: Unit = {
21+
val reified = reify {
22+
if (true) {
23+
!Return(!Await(Future(42)))
24+
}
25+
-1
26+
}
27+
assertEquals(42, result(reified.to[Future], Duration.Inf))
28+
}
29+
1830
type Id[A] = A
1931

2032
@Test

0 commit comments

Comments
 (0)