On 03/06/2017 11:17 AM, Igor Stasenko wrote:
> You got me with this...
> Hey, stop confusing people, put #== everywhere! :) 
> 
> But if seriously, #assert:equals: hides this detail from us, that's why
> it looks confusing..
> IMO, for given case it would be better to use just straight #assert:,
> with explicit expression that using #= for comparands.

assert: (anExpression = someOtherExpression)

may, in some cases, be slightly more intention-revealing than

assert: anExpression equals: someOtherExpression

However, I'd like to advocate for the latter, for ease of debugging.
I've been in too many situations where a test fails an equality test,
and the failure is not easily reproducible.

In the debugger, if #assert: was used I'm left with "false" as my only
clue to what happened. OTOH, if #assert:equals: was used, I have both
the expected value and the actual value in the debugger, which is a much
better clue as to the nature of the problem.

Regards,

-Martin

Reply via email to