Minor. Use coroutine test helpers for inline/diagnostics tests
It should help with decreasing test data copy-pasting when testing against release / pre-release coroutines
This commit is contained in:
+3
-11
@@ -1,8 +1,10 @@
|
||||
// FILE: test.kt
|
||||
// COMMON_COROUTINES_TEST
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
|
||||
import COROUTINES_PACKAGE.*
|
||||
import helpers.*
|
||||
|
||||
// Block is allowed to be called from nested classes/lambdas (as common crossinlines)
|
||||
// Are suspend calls possible inside lambda matching to the parameter
|
||||
@@ -26,17 +28,7 @@ inline fun test2(crossinline c: suspend () -> Unit) {
|
||||
}
|
||||
|
||||
fun builder(c: suspend () -> Unit) {
|
||||
c.startCoroutine(object: Continuation<Unit> {
|
||||
override val context: CoroutineContext
|
||||
get() = EmptyCoroutineContext
|
||||
|
||||
override fun resume(value: Unit) {
|
||||
}
|
||||
|
||||
override fun resumeWithException(exception: Throwable) {
|
||||
throw exception
|
||||
}
|
||||
})
|
||||
c.startCoroutine(EmptyContinuation)
|
||||
}
|
||||
|
||||
// FILE: box.kt
|
||||
|
||||
Reference in New Issue
Block a user