https://kotlinlang.org logo
#kotest
Title
# kotest
d

dimsuz

07/19/2022, 12:12 PM
Is there a matcher to assert each element of the list matches some predicate? Something like
Copy code
stringList shouldHaveEach { it.length > 10 }
I have found
shouldMatchEach
but it requires assertions.size == list.size, not quite what I'm looking for. Or should I just use
Copy code
stringList.forEach { it.length shouldBeGreaterThan 10 }
s

sam

07/19/2022, 12:48 PM
d

dimsuz

07/19/2022, 1:17 PM
Great, didn't know about them, thanks!
7 Views