[Commonizer] AbstractCommonizerTest.doTestFailure: Support single invocation commonizers

^KT-48288
This commit is contained in:
sebastian.sellmair
2021-09-13 09:49:15 +02:00
committed by Space
parent 4e6ad03df6
commit 36a5b53398
@@ -48,6 +48,9 @@ abstract class AbstractCommonizerTest<T, R> {
val commonized = createCommonizer().apply {
variants.forEachIndexed { index, variant ->
val result = commonizeWith(variant)
if (index == variants.lastIndex) {
if (this.result == null) failInEmptyState()
}
if (index >= failureIndex) assertFalse(result, "Expected to fail at index $index")
else assertTrue(result, "Expected to not fail at index $index")
}