Colton Idle
04/02/2023, 11:10 PMsuspend fun <T> retryWithDelay(
retryCount: Int
delay: Duration,
thing: ()->Unit
How would you all write a unit test for that?
I think I'd like to make sure that my delay duration is actually respected, but putting in a test that slows down the rest of the test suite seems bad?ephemient
04/02/2023, 11:25 PMColton Idle
04/02/2023, 11:35 PMephemient
04/02/2023, 11:40 PMStandardTestDispatcher
and assert that nothing runs at the current time and then does run when you manually advance the timeColton Idle
04/02/2023, 11:47 PMcedric
04/24/2023, 11:32 PM@Clock
object, never use static time measurements.ephemient
04/25/2023, 12:06 AMTimeSource
, but neither is necessary if using `withTimeout`/`withTimeoutOrNull`Colton Idle
04/25/2023, 12:46 PM