
commonMain.io.kotest.properties.shrinking.ListShrinker.kt Maven / Gradle / Ivy
package io.kotest.properties.shrinking
class ListShrinker : Shrinker> {
override fun shrink(failure: List): List> {
return if (failure.isEmpty()) emptyList() else {
listOf(
emptyList(),
failure.takeLast(1),
failure.take(failure.size / 3),
failure.take(failure.size / 2),
failure.take(failure.size * 2 / 3),
failure.dropLast(1)
)
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy