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

Map entry matchers #123

Merged
merged 3 commits into from
Apr 6, 2016
Merged

Conversation

tomwhoiscontrary
Copy link

This adds two complementary matchers for working with maps.

The main matcher is IsMapWithEntries, which is just a FeatureMatcher for Map::entrySet. This is essentially an escape hatch from the world of maps to the world of true collections; it allows a user to write matches on maps in terms of their set of entries, using the rich set of matchers available for collections (principally contains and friends).

The second matcher is IsMapEntry, which makes it easy to write matches on the map entries themselves.

I end up writing these two matchers, in some form, in most projects i work on, because this approach so useful. Specifically, i think it's much more useful to be able to view maps as collections than it is to have a range of matchers specifically for maps.

It's possible i'm simply insane, and nobody else will find these useful. But just in case they do, here they are!

@sf105 sf105 merged commit 558b6a6 into hamcrest:v2.0.0.0 Apr 6, 2016
@sf105
Copy link
Member

sf105 commented Apr 6, 2016

I can't get this to merge javadoc is broken because it doesn't recognise @deprecated, rather than @deprecated. Please fix.

@tomwhoiscontrary
Copy link
Author

@sf105 Is that comment meant for this PR? I'm on my phone so can't be sure, but I don't think there's any @deprecated, of any capitalisation, in this PR.

@sf105
Copy link
Member

sf105 commented Apr 7, 2016

You branched from an old version of hamcrest that doesn't build in Java 8 any more. I might just branch again and fix it.

S

On 6 Apr 2016, at 16:59, Tom Anderson [email protected] wrote:
@sf105 Is that comment meant for this PR? I'm on my phone so can't be sure, but I don't think there's any @deprecated, of any capitalisation, in this PR.


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub

@tomwhoiscontrary
Copy link
Author

Got it. I'll jump on this at the weekend, when I'm back in front of a computer.

@tomwhoiscontrary
Copy link
Author

Okay, so:

  1. I based my branch off the v2.0.0.0 branch, for some reason
  2. My branch merges cleanly into the v2.0.0.0 branch, and you've done that
  3. The v2.0.0.0 branch prior to my commits did not build under Java 8 due to javadoc problems, and is still broken after my commits
  4. The master branch is not a descendant of the v2.0.0.0 branch
  5. The master branch does build under Java 8
  6. Neither my branch nor the old v2.0.0.0 branch merge cleanly into the master branch

So whilst the problems on the v2.0.0.0 branch are not of my making, the problem that my branch is built on that branch is!

It seems like the best thing would be to merge v2.0.0.0 into master, as you have done in the past; however, i'm not sure i know enough about the changes in either branch to do that properly. Alternatively, i could cherry-pick my changes onto master, and submit a new PR. Or i could just leave it to you. What would you like me to do?

@tomwhoiscontrary
Copy link
Author

This has now become #160.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants