Ioannis Mavroukakis
02/17/2023, 12:45 PMCLOVIS
02/17/2023, 12:58 PMIoannis Mavroukakis
02/17/2023, 1:08 PMtest("test list contains all elements"){
val strings = listOf("One", "two", "three")
strings.shouldContainAll("One", "two", "three","four")
}
gives me
Collection should contain all of ["One", "two", "three", "four"] but was missing ["four"]test("test list contains all elements"){
val strings = listOf("One", "two", "three","five")
strings.shouldContainAll("One", "two", "three","four")
}
kotest tells me that four
is missing, but I have no clue that a five
has snuck inshouldContainExactly
behaves in the expected wayCLOVIS
02/17/2023, 1:11 PMshouldContainExactly
, or even just shouldBe
Ioannis Mavroukakis
02/17/2023, 1:16 PMCLOVIS
02/17/2023, 1:17 PMassertSoftly
it creates the clue automatically IIRCIoannis Mavroukakis
02/17/2023, 1:23 PMassertSoftly(strings){
shouldContainAll("One", "two", "three","four")
}
CLOVIS
02/17/2023, 1:23 PMIoannis Mavroukakis
02/17/2023, 1:23 PMCLOVIS
02/17/2023, 1:24 PMassertSoftly
imply withClue
Ioannis Mavroukakis
02/17/2023, 1:27 PMasClue
the output is nowhere near as nice by default as with the shouldContainExactly
[One, two, three, five]
java.lang.AssertionError: [One, two, three, five]
CLOVIS
02/17/2023, 1:53 PM