Very similar matchers handle duplicates differentl...
# kotest
a
Very similar matchers handle duplicates differently:
Copy code
"sequences vs lists" {
            //fails
            listOf(1, 2, 2, 3) shouldContainExactlyInAnyOrder listOf(1, 2, 3, 3)
         }

         "sequences vs lists2" {
            //passes
            sequenceOf(1, 2, 2, 3) shouldContainAllInAnyOrder sequenceOf(1, 2, 3, 3)
         }
is that intentional?
l
Yes, it's intentional. On the second example you're saying "Hey kotest, check that list A contains these elements: X, Y, Z and Z in any order", while on the first one you're saying "Hey Kotest, check that list A contains EXACTLY these elements: X, Y, Z, Z but in any order"
a
thanks a lot!