Skip to content
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

Add MapSubject#containsAnyOf #990

Open
nakulj opened this issue Jun 7, 2022 · 2 comments
Open

Add MapSubject#containsAnyOf #990

nakulj opened this issue Jun 7, 2022 · 2 comments
Labels
P4 not scheduled type=addition A new feature

Comments

@nakulj
Copy link

nakulj commented Jun 7, 2022

I have a test that can create a map with one of two possible entries.
It would be nice if I could use containsAnyOf like I can with an IterableSubject.

@amalloy amalloy added type=addition A new feature P4 not scheduled labels Jun 10, 2022
@amalloy
Copy link

amalloy commented Jun 10, 2022

Until such time as that method may be added, you could work around it by using containsAnyOf on the map's entrySet().

@cpovirk
Copy link
Member

cpovirk commented Jun 13, 2022

Alan's response is better than my first thought, and you should do that :)

In a slightly different situation, you might find it useful to use Fuzzy Truth (a.k.a. comparingValuesUsing): You could specify the key you expect and (essentially) a predicate that matches any of the values you expect.

But hopefully we'll add the thing you really want eventually. Thanks for the request.

[edit: subsequent discussion in internal CL 669596993]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P4 not scheduled type=addition A new feature
Projects
None yet
Development

No branches or pull requests

3 participants