Files
kotlin-fork/native/native.tests/testData/standalone/termination/unhandledExceptionInWorkerExecute.kt
T
2024-03-15 01:28:01 +00:00

18 lines
472 B
Kotlin
Vendored

// No termination is going on here. But that's the closest location to other unhandled exception hook tests.
// KIND: REGULAR
// OUTPUT_REGEX: .*an error.*
import kotlin.test.*
import kotlin.native.concurrent.*
@Test
fun testExecuteStart() {
val worker = Worker.start()
val future = worker.execute(TransferMode.SAFE, {}) {
throw Error("an error")
}
assertFailsWith<Throwable> {
future.result
}
worker.requestTermination().result
}