Possible confusion between shouldContainExactlyInAnyOrder
overloads
#2587
Labels
assertions 🔍
Related to the assertion mechanisms within the testing framework.
bug 🐛
Issues that report a problem or error in the code.
Milestone
Using Kotest 4.6.3 with Kotlin 1.5.31
There is a possible confusion for user between these overloads of
shouldContainExactlyInAnyOrder()
assertion:When using an optional collection for
expected
, Kotlin will use thevararg
parameter implementation, which will fails as it checks ifexpected
is an item in the actual collection instead of comparing both collections.Allowing optional collection would likely prevent this issue
Example
The text was updated successfully, but these errors were encountered: