JavaHamcrest icon indicating copy to clipboard operation
JavaHamcrest copied to clipboard

Make IsIterableContainingInAnyOrder try all matcher permutations

Open Gnurfos opened this issue 5 years ago • 5 comments

This is a fix for issue #248 I'm not sure about the names I used, but could not find better ones. Don't hesitate to propose some.

This introduces some loss of information in mismatch reports in some cases (which precise matchers or items remained unpaired), but on the other hand, the full list of items is printed all the time (which, from my experience, is more useful to the user, in non-ordered cases).

This information could be reintroduced if needed, at the cost of some added complexity and performance.

Gnurfos avatar Mar 05 '19 12:03 Gnurfos

This looks like a lot of extra complexity for not a lot of benefit.

What problem does this fix? Is there a specific use case this change addresses?

tumbarumba avatar Apr 02 '19 21:04 tumbarumba

Ah! I just read #248, I see the use case you're concerned about

tumbarumba avatar Apr 02 '19 22:04 tumbarumba

@Gnurfos think i understand the issue so should probably be merged.

please can you rebase from master, as hamcrest-core and hamcrest-library have been refactored a lot and also deprecated, so that everything is just in hamcrest.

nhojpatrick avatar Jun 29 '20 21:06 nhojpatrick

Going to try and kick start hamcrest, so if you want to get it merged, please rebase from the branch v2.3-candidates. Still trying to understand how has permissions to perform a release.

nhojpatrick avatar Feb 13 '22 12:02 nhojpatrick

@FichteFoll I agree with all the concerns you listed above. What I did at the time was fitting my needs, and I valued correctness of the test above all else, but I understand that it's not good enough (reporting and performance) for the general case.

Unfortunately, I'm not into Java at the moment, and won't be able to put efforts into this in any foreseeable time. Feel free to close this pull request, as I'm afraid not much of it would be of use, with a different algorithm.

Gnurfos avatar Aug 30 '22 10:08 Gnurfos