solonovamax
02/07/2025, 2:00 AMa809fe13
.sam
02/07/2025, 2:10 AMsolonovamax
02/07/2025, 2:10 AMsam
02/07/2025, 2:10 AMsam
02/07/2025, 2:10 AMsolonovamax
02/07/2025, 2:11 AMsam
02/07/2025, 2:12 AMsam
02/07/2025, 2:13 AMsam
02/07/2025, 2:13 AMsam
02/07/2025, 2:13 AMsam
02/07/2025, 2:13 AMsolonovamax
02/07/2025, 2:14 AMcontext(context) {
precomputed.forEach {
withClue({ getStableIdentifier(it) }) {
resultFunction(it.first, it.second) shouldBe (it.result plusOrMinus DEFAULT_TOLERANCE)
}
}
}
to replace
context(context) {
withData(precomputed) {
resultFunction(it.first, it.second) shouldBe (it.result plusOrMinus DEFAULT_TOLERANCE)
}
}
which is used on all other platformssolonovamax
02/07/2025, 2:14 AMcontext
and withData
on all platformssam
02/07/2025, 2:16 AMsam
02/07/2025, 2:16 AMsam
02/07/2025, 2:16 AMsolonovamax
02/07/2025, 2:18 AMexpect fun FunSpecRootScope.testPrecomputed(
context: String,
precomputed: List<FuzzyTestData>,
resultFunction: (String, String) -> Double,
)
expect fun <T, U, V> FunSpecRootScope.testPrecomputed(
context: String,
precomputed: List<Triple<T, U, V>>,
resultFunction: (T, U) -> V,
)
though as an implementation detail, I do currently know that the things passed into the first 2 generics of the tripple are strings and the last is always a Pair<Int, Int>
, so I guess for now I could just use .toString()
solonovamax
02/07/2025, 2:19 AMsam
02/07/2025, 2:20 AMsam
02/07/2025, 2:20 AMsam
02/07/2025, 2:20 AMsam
02/07/2025, 2:20 AMsolonovamax
02/07/2025, 2:20 AMsam
02/07/2025, 2:21 AMsam
02/07/2025, 2:21 AMsam
02/07/2025, 2:21 AMsolonovamax
02/07/2025, 2:21 AMsam
02/07/2025, 2:22 AMsam
02/07/2025, 2:22 AMsolonovamax
02/07/2025, 2:23 AMsam
02/07/2025, 2:23 AMsam
02/07/2025, 2:23 AMsolonovamax
02/07/2025, 2:25 AMsolonovamax
02/21/2025, 12:52 AMsolonovamax
03/04/2025, 3:54 PM