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"]Ioannis Mavroukakis
02/17/2023, 1:10 PMtest("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 inIoannis Mavroukakis
02/17/2023, 1:11 PMshouldContainExactly
behaves in the expected wayIoannis Mavroukakis
02/17/2023, 1:11 PMCLOVIS
02/17/2023, 1:11 PMCLOVIS
02/17/2023, 1:12 PMshouldContainExactly , or even just shouldBeIoannis Mavroukakis
02/17/2023, 1:16 PMIoannis 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 PMIoannis Mavroukakis
02/17/2023, 1:24 PMCLOVIS
02/17/2023, 1:24 PMassertSoftly imply withClueIoannis 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]Ioannis Mavroukakis
02/17/2023, 1:28 PMIoannis Mavroukakis
02/17/2023, 1:28 PMCLOVIS
02/17/2023, 1:53 PM