JavaHamcrest icon indicating copy to clipboard operation
JavaHamcrest copied to clipboard

Java (and original) version of Hamcrest

Results 146 JavaHamcrest issues
Sort by recently updated
recently updated
newest added

Hi I tried to implement stringContainsInAnyOrder in my fork, but I found that we have already a duplicated #173 PR since 2017 with merge conflicts. I'm waiting for feedback. Thanks

I'd be nice if matchers involving whitespace, like `equalToCompressingWhiteSpace` would expand on which whitespace definition is used since there're a lot of them out there. For instance, it's not even...

enhancement

It would be very useful to add a Hamcrest matched to FileMatchers that allows comparison of file contents, instead of separately validating that the file exists, is readable and then...

enhancement
Hamcrest future

If large texts are compared with `equalTo`, you just get both texts in full, and ultimately have to copy them out to text files manually and run a diff tool...

Case: ``` List list = Arrays.asList("a", "b", "c"); String[] cd = {"c", "d"}; assertThat("Should not contain each item", list, not(hasItems(cd))); ``` This assertion won't fail. I understand why it will...

I have a List of Lists and for that I wanted to check the contents. Therefore, I nested Matchers.empty() and Matchers.contains() inside Matchers.contains() - but the test failed, saying that...

bug

It seems convinient to have a XPath-Matcher that is not limited to only look into the first matched element for the XPath Example-XML: ``` A-ISBN A-Book B-ISBN B-Book ``` will...

suggestion: would be good to duplicate not(T value) with isNot(T value) not(Matcher matcher) with doesNot(Matcher matcher) hasX(...) with (haveX(...)) for reasons of grammer assertThat(myList, doesNot(haveItem(myItem)); assertThat(mySet, isNot(empty));

enhancement

The naming of the matcher implies it would give consistent results with `String.isBlank()`. However, it does not. The matcher uses a regex with pattern `\\s*` which will only match ASCII...

Since version 4.13, JUnit has added `assertThrows`, with typical JUnit style "expected first argument, actual second argument". Hamcrest does not have a declarative equivalent. **As a** developer, **I want to**...