[Cuis-dev] Re : Re: Test error message wrongly formatted

Hilaire Fernandes hfern at free.fr
Mon Jul 24 09:02:18 PDT 2023


I was referring to the message *#assert:equal:* not #assert:equalsExpected:

I don't understand why the method #assert:equalsExpected: exists

Just reversing the argument in message send 
*#comparingStringBetween:and:* will make the error message looks right. 
So in that case the argument of the method #assert:equals: do not need 
to be reversed.

assert: expected equals: actual
     self
         assert: expected = actual
         description: [ *self comparingStringBetween: expected and: 
actual *]

Most of the Test I see in my working image use #assert:equal: (NeoCSV, 
Locale, Smalltalk-UI) that way so failed test error message will looks 
wrong and misleading.

Personally I just use #assert:

Hilaire


Le 24/07/2023 à 15:13, Juan Vuletich a écrit :
> If I evaluate:
>
> TestCase new assert: 'actual value' equalsExpected: 'expected value'
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20230724/09071ba7/attachment.htm>


More information about the Cuis-dev mailing list