Patrick Steiger
04/07/2023, 10:51 PMrunCurrent
be used to advance the event loop in case of nested coroutines launched with UnconfinedTestDispatcher
?
Below code outputs 1 2 4 3 5
fun test() = runTest(UnconfinedTestDispatcher()) {
println(1)
launch {
println(2)
launch { println(3) }
runCurrent()
println(4)
}
println(5)
}
Ky
04/10/2023, 11:41 PMPatrick Steiger
04/10/2023, 11:43 PMStackOverflowException
Same for Dispatchers.Main.immediate
Ky
04/11/2023, 12:16 AMPatrick Steiger
04/11/2023, 12:17 AMKy
04/11/2023, 12:21 AMPatrick Steiger
04/11/2023, 12:25 AM