<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Hi Folks,<br>
<br>
On 7/24/2023 5:23 AM, Hilaire Fernandes via Cuis-dev wrote:
<blockquote cite="mid:3a3ee513-9707-60b9-c4d4-033318416c6b@free.fr"
type="cite">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<p>Hi Hernán, <br>
</p>
<p>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:)</p>
<p>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. <br>
</p>
</blockquote>
<br>
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".<br>
<br>
Looks right to me...<br>
<br>
<blockquote cite="mid:3a3ee513-9707-60b9-c4d4-033318416c6b@free.fr"
type="cite">
<p> </p>
<p>Alternatively, reversing the argument in the methos as shown
below will fix it:</p>
<p>...</p>
<p>self comparingStringBetween: <b>actual</b> and: <b>expected</b></p>
<p><b>...</b></p>
<p><b><br>
</b></p>
<p>and make the error message read right.</p>
<p>Hilaire<br>
</p>
<div class="moz-cite-prefix">Le 24/07/2023 à 04:29, Hernán
Wilkinson via Cuis-dev a écrit :<br>
</div>
<blockquote type="cite"
cite="mid:CAGgF3Gz3H6_qbgP+pCcTg7wRY7pu5-UP_BWmok9TEiNGqL_vvg@mail.gmail.com">Hi
Hilaire<br>
<div> I think all of us that used #assert:equals: had the same
feeling as you someday. </div>
<div> 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).</div>
<div> We should not change it for historical and compatibility
reasons.</div>
<div> Adding the message you suggest will not harm, but it is
redundant...</div>
<div> 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.</div>
<div><br>
</div>
</blockquote>
</blockquote>
<br>
I think clarity trumps historical reasons. In any case, it is best
to have both variants and let callers decide which they prefer.<br>
<br>
Thanks,<br>
<pre class="moz-signature" cols="72">--
Juan Vuletich
cuis.st
github.com/jvuletich
researchgate.net/profile/Juan-Vuletich
independent.academia.edu/JuanVuletich
patents.justia.com/inventor/juan-manuel-vuletich
linkedin.com/in/juan-vuletich-75611b3
twitter.com/JuanVuletich</pre>
</body>
</html>