-
Notifications
You must be signed in to change notification settings - Fork 5
Add contains stream matcher for checking "in any order" #6
Comments
Thanks, this is a good idea. I'm implementing this feature now. In the course of doing this, I've noticed that the behaviour of
but In the course of fixing this, I'll create the feature that you've asked for. Thanks for your patience! |
Neither of those should pass if we're going to stick with normal hamcrest syntax: http://hamcrest.org/JavaHamcrest/javadoc/1.3/org/hamcrest/Matchers.html#contains(E...)
|
Indeed. I'm not convinced that we should follow hamcrest's conventions, though. Or at least, we should create some matchers with good names, and then allow the hamcrest names to alias them where we think it will help people who are already familiar with the hamcrest style. |
Actually, I often find myself using both Hamcrest's matchers and java-8-matchers in the same test class, which prevents me from static importing different matchers with the same name. Which is also a case against trying to make the matcher names in this library "familiar" for existing Hamcrest users by reusing the names. I am also not convinced that following Hamcrest's conventions is a good idea, as their matchers often can be ambiguously or imprecisely named. (It is not immediately obvious that |
I'm looking for something like
IsCollectionContaining.<T>hasItems(items);
so that I can writeinstead of
The text was updated successfully, but these errors were encountered: