JavaHamcrest icon indicating copy to clipboard operation
JavaHamcrest copied to clipboard

duplicate methods for grammar reasons

Open gerardh opened this issue 7 years ago • 1 comments

suggestion: would be good to duplicate

not(T value) with isNot(T value) not(Matcher<T> matcher) with doesNot(Matcher<T> matcher) hasX(...) with (haveX(...))

for reasons of grammer

assertThat(myList, doesNot(haveItem(myItem)); assertThat(mySet, isNot(empty));

gerardh avatar Nov 15 '18 13:11 gerardh

Some of what you're suggesting is possible with the is matcher, e.g. is(not(T value)). If anything should be done for this, I suggest to avoid duplicating methods, but instead consider exploiting identity matchers more, and maybe add does and has as matchers.

peterdemaeyer avatar Mar 04 '21 22:03 peterdemaeyer