mirror of
https://github.com/austinried/subtracks.git
synced 2026-11-16 01:00:17 +01:00
test: pin awaitUntil's single predicate evaluation
The helper used to evaluate its predicate once more when leaving the loop, so a briefly-true predicate failed with a timeout that had not elapsed. Cover that directly instead of relying on a caller that happens to be transiently true.
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
package com.subtracks
|
||||
|
||||
import org.junit.Test
|
||||
|
||||
class TestSupportTest {
|
||||
@Test
|
||||
fun returnsWhenThePredicateIsBrieflyTrue() {
|
||||
var calls = 0
|
||||
awaitUntil("the predicate is briefly true") { ++calls == 1 }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user