solonovamax
09/25/2025, 7:17 PMStableIdents.getStableIdentifier(Any?) be re-exposed so that it can be used?
I was using it for the kotlin/js platform because I could not use withData(), as it would result in an error saying "Nested tests are not supported". my workaround for this was to instead use withClue() on the kotlin/js platform, doing this:
actual fun FunSpecRootScope.testPrecomputed(
context: String,
precomputed: List<FuzzyTestData>,
resultFunction: (String, String) -> Double,
) {
context(context) {
precomputed.forEach {
withClue({ getStableIdentifier(it) }) {
resultFunction(it.first, it.second) shouldBe (it.result plusOrMinus DEFAULT_TOLERANCE)
}
}
}
}
in kotest 6.0.0, this would instead be changed to use StableIdents.getStableIdentifier(it), however this does not work because StableIdents is internal.
I was told previously that nested tests would be present in 6.0, however they don't seem to be.Alex Kuznetsov
09/25/2025, 9:03 PMpublic without much effort. WDYT @sam?solonovamax
09/25/2025, 9:09 PMwithData() function is defined per-style, so if you defined your own style you wouldn't be able to use itsam
09/26/2025, 2:25 AMsam
09/26/2025, 2:25 AMsolonovamax
10/06/2025, 8:41 PMStableIdents.getStableIdentifier(Any?), as currently nested tests do not work on kotlin/js, so I need to use withClue() which does not compute the stable identifierAlex Kuznetsov
10/09/2025, 12:15 AMAlex Kuznetsov
10/09/2025, 6:21 PMsolonovamax
10/10/2025, 12:40 AMsam
10/10/2025, 12:41 AMAlex Kuznetsov
10/10/2025, 12:43 PM