You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hamcrest used is() for equality (and overloaded it for isInstanceOf). I think obj == obj is (should be) a rare enough assertion (in situations where it differs from obj.equals(obj)) that it deserves a longer name than obj.equals(obj).
Can we make is() a shorthand for isEqualTo, and make the current is() isTheSameAs(), or some such? I think we should have both longer aliases, anyway, for people who want to be explicit.
The text was updated successfully, but these errors were encountered:
Just to clarify - you're suggesting that we have is() exist, but simply delegate to isEqualTo(), hten make isTheSameAs() or isExactly()?
I'm ok with that, except that the english meaning of "is" is identity, and I don't want to confuse things... but frankly it's all confused already.
I used "isA()" for instanceof, since that's a common O-O phrase.
In principle, I"m ok with this, though I'm tempted to ditch is() altogether as too misleading. I just can't bring myself to lose it as a terse nice word in the phrasing of tests. :(
Yes, I'm saying that people coming from hamcrest are used to seeing is(), but in hamcrest, is === isEqualTo. I would argue that in Java, it's good practice to thing of .equals as being "real equality", and == as an implementation detail that sometimes accidentally coincides with "real equality"
Hamcrest used is() for equality (and overloaded it for isInstanceOf). I think obj == obj is (should be) a rare enough assertion (in situations where it differs from obj.equals(obj)) that it deserves a longer name than obj.equals(obj).
Can we make is() a shorthand for isEqualTo, and make the current is() isTheSameAs(), or some such? I think we should have both longer aliases, anyway, for people who want to be explicit.
The text was updated successfully, but these errors were encountered: