[K/N][tests] Migrate various runtime/ tests ^KT-61259
This commit is contained in:
committed by
Space Team
parent
7ad4e58a7a
commit
d88092aa94
+19
@@ -0,0 +1,19 @@
|
||||
// OUTPUT_REGEX: ^$
|
||||
@file:OptIn(FreezingIsDeprecated::class, ObsoleteWorkersApi::class)
|
||||
|
||||
import kotlin.test.*
|
||||
|
||||
import kotlin.native.concurrent.*
|
||||
|
||||
// Ensure that termination of current worker on main thread doesn't lead to problems.
|
||||
fun main() {
|
||||
val worker = Worker.current
|
||||
val future = worker.requestTermination(false)
|
||||
worker.processQueue()
|
||||
assertEquals(future.state, FutureState.COMPUTED)
|
||||
future.consume {}
|
||||
// After termination request this worker is no longer addressable.
|
||||
assertFailsWith<IllegalStateException> { worker.executeAfter(0, {
|
||||
println("BUG!")
|
||||
})}
|
||||
}
|
||||
Reference in New Issue
Block a user