-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rationalize contains matcher #49
Comments
+1 To me, the implicit |
I think I do agree that |
Here's why I still don't like it.
|
I suppose I'd be okay with marking
Hopefully we'll also have overloads by that point, so we'll just define two overloads. Equivalently, we could type
This seems much less useful than the current behavior, since the only widely-used types that implement |
Right now, contains works on Iterables, Strings, and Maps. For Iterables, I believe it is equivalent to the anyElement matcher. For String, I think it is equivalent to the matches matcher (in string_matchers). For Maps, it does containsKey (which is surprising on its own), and a new matcher would need to be created.
Maybe contains should be deprecated in favor of the equivalent matchers mentioned above? Or at least perhaps the behavior can be made more consistent. It takes a Matcher for Iterable, but not String or Maps.
The text was updated successfully, but these errors were encountered: