assertEmpty
open fun <E : KoBaseProvider> List<E?>.assertEmpty(strict: Boolean = false, additionalMessage: String? = null, testName: String? = null): Nothing(source)
Deprecated (with error)
katachi cannot see which declarations assertEmpty rejected. Use mustBeEmpty.
Replace with
mustBeEmpty()Content copied to clipboard
Konsist's own emptiness assertion over a list. Not usable here — see assertTrue.
Example 1: what to write instead
classes().filter { it.hasPublicOrDefaultModifier }.assertEmpty() // compile error
classes().filter { it.hasPublicOrDefaultModifier }.mustBeEmpty() // okContent copied to clipboard
open fun <E : KoBaseProvider> Sequence<E?>.assertEmpty(strict: Boolean = false, additionalMessage: String? = null, testName: String? = null): Nothing(source)
Deprecated (with error)
katachi cannot see which declarations assertEmpty rejected. Use toList() then mustBeEmpty.
Replace with
toList().mustBeEmpty()Content copied to clipboard
Konsist's own emptiness assertion over a sequence. Not usable here — see assertTrue.
Example 1: what to write instead
classes().asSequence().assertEmpty() // compile error
classes().asSequence().toList().mustBeEmpty() // okContent copied to clipboard