From 5a4ca71cfa5c4578f6da9bdb9cda5f76dcbb66c7 Mon Sep 17 00:00:00 2001 From: austinried <4966622+austinried@users.noreply.github.com> Date: Sat, 14 Nov 2026 12:59:41 +0000 Subject: [PATCH] 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. --- app/src/test/kotlin/com/subtracks/TestSupportTest.kt | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 app/src/test/kotlin/com/subtracks/TestSupportTest.kt diff --git a/app/src/test/kotlin/com/subtracks/TestSupportTest.kt b/app/src/test/kotlin/com/subtracks/TestSupportTest.kt new file mode 100644 index 00000000..074e3b74 --- /dev/null +++ b/app/src/test/kotlin/com/subtracks/TestSupportTest.kt @@ -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 } + } +}