Move test from js to common part
This commit is contained in:
+31
@@ -0,0 +1,31 @@
|
||||
// IGNORE_BACKEND: JS_IR
|
||||
// IGNORE_BACKEND: JVM_IR
|
||||
// WITH_RUNTIME
|
||||
// WITH_COROUTINES
|
||||
// COMMON_COROUTINES_TEST
|
||||
import helpers.*
|
||||
import COROUTINES_PACKAGE.*
|
||||
import COROUTINES_PACKAGE.intrinsics.*
|
||||
|
||||
suspend inline fun doTwice(block: suspend () -> Unit) {
|
||||
block()
|
||||
block()
|
||||
}
|
||||
|
||||
var testResult: String = ""
|
||||
|
||||
fun build(c: suspend () -> Unit) {
|
||||
c.startCoroutine(EmptyContinuation)
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
|
||||
build {
|
||||
doTwice {
|
||||
testResult += "OK"
|
||||
return@build
|
||||
}
|
||||
}
|
||||
|
||||
return testResult
|
||||
}
|
||||
Reference in New Issue
Block a user