reactormonk
08/01/2023, 5:31 PMcomposeTestRule
. This code:
kotlin
fun BugTesting() {
Log.d("Testing", "Testing")
val someVar by produceState(1) {
delay(100)
value = 2
Log.d("Testing", "Set value to $value")
delay(100)
value = 3
Log.d("Testing", "Set value to $value")
delay(100)
value = 4
Log.d("Testing", "Set value to $value")
delay(100)
value = 5
Log.d("Testing", "Set value to $value")
}
Log.d("Testing", "Var: $someVar")
Column {
Text("Var: $someVar", color = Color.Red)
}
}
Only shows
Testing
Var: 1
Nothing more. I initially assumed it'd be an issue with robolectric (https://github.com/robolectric/robolectric/issues/8368), but running it on android hardware, I'm getting a similar behavior. outside of test context, the code runs fine.