472ec72eb9
1. Move tests to their own module 2. Avoid sharing the 'tinyApp' project between tests 3. Clean up option directive handling
35 lines
614 B
Kotlin
Vendored
35 lines
614 B
Kotlin
Vendored
// ATTACH_LIBRARY: coroutines
|
|
|
|
package soSuspendableCallInEndOfLambda
|
|
|
|
import forTests.builder
|
|
import forTests.WaitFinish
|
|
import kotlin.coroutines.Continuation
|
|
import kotlin.coroutines.*
|
|
|
|
private fun foo(a: Any) {}
|
|
|
|
val waiter = WaitFinish()
|
|
|
|
fun main(args: Array<String>) {
|
|
builder {
|
|
foo("Start")
|
|
//Breakpoint!
|
|
run()
|
|
}
|
|
|
|
foo("Main end")
|
|
waiter.waitEnd()
|
|
}
|
|
|
|
suspend fun run() {
|
|
suspendCoroutine { cont: Continuation<Unit> ->
|
|
Thread {
|
|
Thread.sleep(10)
|
|
cont.resume(Unit)
|
|
waiter.finish()
|
|
}.start()
|
|
}
|
|
}
|
|
|
|
// STEP_OVER: 2 |