I've encountered a case where I need assertions li...
# kotest-contributors
a
I've encountered a case where I need assertions like this:
Copy code
listOf(1, 2, 3, 2).shouldContainTimes(element = 2, times = 2)
do we want to add it to kotest? if yes, how should we name it?
โœ… 1
a
shouldContainElementNTimes
?
๐Ÿ‘๐Ÿผ 1
wonder if we want to accept a list of elements rather than a single one?
a
I only need a simple case of one element
a
yeah, but if you are going to build it ๐Ÿ™‚ and if it is going to be an assertion on collections only, might as well make it reusable - that being said, we can always iterate if there is need, so single el sounds good too
๐Ÿ‘๐Ÿผ 1
a
I kinda already built it. All we need is to share it out
๐Ÿ’š 1
s
shouldContainDuplicates or should ContainRepeats?
a
we already have
shouldContainDuplicates
but I like
shouldContainRepeats
actually I'm thinking of
shouldContainExactCount
as we can require
count=1
which is not repeats
s
shouldContainExactCopies ?
๐Ÿ‘๐Ÿผ 1