Add SeqContains and NotSeqContains functions #22
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Given that we have
iter.Seq[T]
now, along with things likemaps.Keys
, which returns aniter.Seq[T]
, it might be nice to have aSeqContains
function in this library since it would have fairly broad applicability and allow some niche things that Testify supports (likeContains
with a map) without polluting the API with niche functions.For example,
is a fairly elegant way to say "has key", without having a highly specialized
HasKey
function.I added the
maxChecked
parameter because a sequence can be infinite, so in some cases it might be useful to set an upper bound. I wouldn't anticipate this being set to anything other than zero very often, so I'm not married to the idea. Implementing aTake(n)
function is pretty easy, so maybe people who need that functionality could just do it that way.I haven't added the negated version or tests because I wasn't sure if this is a desirable addition. Happy to finish it if so.