voddan
02/24/2017, 10:00 AM@Test
fun testBadClass() {
val bad = suspend {
checkBadClassTwice()
getBadClassViaSuspend()
}
var result: BadClass? = null
bad.startCoroutine(object : Continuation<BadClass> { // line 56
override val context: CoroutineContext = EmptyCoroutineContext
override fun resume(value: BadClass) {
assertTrue(result == null)
result = value
}
override fun resumeWithException(exception: Throwable) {
throw exception
}
})
assertTrue(result is BadClass)
assertEquals(3, counter)
}