[Cuis-dev] Test error message wrongly formatted

Hilaire Fernandes hfern at free.fr
Mon Jul 24 01:23:38 PDT 2023


Hi Hernán,

I am not asking to add a message, the second one I mentioned is already 
in the image and may be should be removed (#assert:equalsExpected:)

The problem with the method #asserted:expected:) is that the error 
message is wrong when the test fails, and I am pretty sure I never saw 
it that way before. I have used tests extensively.

Alternatively, reversing the argument in the methos as shown below will 
fix it:

...

self comparingStringBetween: *actual* and: *expected*

*...*

*
*

and make the error message read right.

Hilaire

Le 24/07/2023 à 04:29, Hernán Wilkinson via Cuis-dev a écrit :
> Hi Hilaire
>  I think all of us that used #assert:equals: had the same feeling as 
> you someday.
>  We all expect the actual to be first, but for some reason I do not 
> know Kent Beck put the expected first when he wrote SUnit and all the 
> descendant testing framework followed that convention (JUnit, NUnit, 
> phpunit, etc etc).
>  We should not change it for historical and compatibility reasons.
>  Adding the message you suggest will not harm, but it is redundant...
>  My advice, give it a couple of days, you will get used to it to put 
> the expected first, it is a matter of time.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20230724/3c2afd7a/attachment.htm>


More information about the Cuis-dev mailing list