[Cuis-dev] Test error message wrongly formatted

Hernán Wilkinson hernan.wilkinson at 10pines.com
Mon Jul 24 04:58:38 PDT 2023


Hi,
 sorry Hilaire, I didn't quite understand your first email.
 As Juan says, I see the right error message in the debugger when the
assertion fails.
 I agree with keeping both message as you suggest Juan

Cheers!
Hernan.

On Mon, Jul 24, 2023 at 8:41 AM Juan Vuletich via Cuis-dev <
cuis-dev at lists.cuis.st> wrote:

> Hi Folks,
>
> On 7/24/2023 5:23 AM, Hilaire Fernandes via Cuis-dev wrote:
>
> 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.
>
>
> On a fresh, updated Cuis, `TestCase new assert: 'actual value'
> equalsExpected: 'expected value'` opens a debugger with title "TestFailure:
> Expected 'expected value' but was 'actual value'. - Process: Morphic UI -
> Priority: 40".
>
> Looks right to me...
>
> 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.
>
>
> I think clarity trumps historical reasons. In any case, it is best to have
> both variants and let callers decide which they prefer.
>
> Thanks,
>
> --
> Juan Vuletichcuis.stgithub.com/jvuletichresearchgate.net/profile/Juan-Vuletichindependent.academia.edu/JuanVuletichpatents.justia.com/inventor/juan-manuel-vuletichlinkedin.com/in/juan-vuletich-75611b3twitter.com/JuanVuletich
>
> --
> Cuis-dev mailing list
> Cuis-dev at lists.cuis.st
> https://lists.cuis.st/mailman/listinfo/cuis-dev
>


-- 

*Hernán WilkinsonAgile Software Development, Teaching & Coaching*
*Phone: +54-011*-4893-2057
*Twitter: @HernanWilkinson*
*site: http://www.10Pines.com <http://www.10pines.com/>*
Address: Alem 896, Floor 6, Buenos Aires, Argentina
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cuis.st/mailman/archives/cuis-dev/attachments/20230724/3da1c41b/attachment.htm>


More information about the Cuis-dev mailing list