<!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>
I am delighted and amazed to see this kind of conversation taking
place in our community. Martin, this is invaluable! Thank you all.<br>
<br>
On 7/30/2023 7:15 PM, Hernán Wilkinson via Cuis-dev wrote:
<blockquote
cite="mid:CAGgF3Gz7AJ4UztHcOnsG8hkW8qBM=FqDNGn9z5BizeP=TBgi4g@mail.gmail.com"
type="cite">
<div dir="ltr">Hi Martin,
<div> thank you for your explanation! I thought it was in SUnit
because JUnit, NUnit and others have the assert:equals: (or
assertEquals(...), etc) and I thought they took it from SUnit.
But you are right, I remember using SUnit back in 2002 and no
assert:equals: existed, I saw it the first time in JUnit.</div>
<div> JUnit, NUnit, etc have the expected as first parameter.
Maybe the one we have now was copied from JUnit that follows
that convention then...</div>
<div> Regarding what to do with the parameters order, now with
your explanation I do not have a preference... if there are
non historical reasons then maybe having actual first is
better, is what most people think it should be (even me!). It
won't be the same as JUnit but I think we do not really care
about that, do we? :-)</div>
</div>
</blockquote>
<br>
I would care a bit about JUnit, but indeed I care more about the
wider Smalltalk community. It seems we inherited the confusion from
Squeak. I take Pharo's side on this one, and I suggest following
Martin's advice, even if we'll need to review quite a few tests.<br>
<br>
Thanks,<br>
<br>
<blockquote
cite="mid:CAGgF3Gz7AJ4UztHcOnsG8hkW8qBM=FqDNGn9z5BizeP=TBgi4g@mail.gmail.com"
type="cite">
<div dir="ltr">
<div><br>
</div>
<div>Cheers!</div>
<div>Hernan.</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Sun, Jul 30, 2023 at
6:59 PM Martin McClure <<a moz-do-not-send="true"
href="mailto:martin@hand2mouse.com">martin@hand2mouse.com</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin: 0px 0px 0px
0.8ex; border-left: 1px solid rgb(204, 204, 204);
padding-left: 1ex;">Hi Hernán,<br>
<br>
I'm afraid you can't blame Kent Beck for this ambiguity.<br>
<br>
#assert:equals: was not in Kent's original SUnit design -- at
least it's <br>
not in his paper from 1999, and it's not in Camp Smalltalk
SUnit 3.1 <br>
from 2003.<br>
<br>
At GemStone, we have an internal test framework that existed
before <br>
SUnit did, and its primary way of doing assertions is<br>
<br>
self run: aBlock forResult: anObject.<br>
<br>
Fifteen years ago or so, Niall Ross was the primary SUnit
maintainer, <br>
and I suggested to him that SUnit could benefit from something
like <br>
#run:forResult:. He didn't think that particular selector fit
SUnit's <br>
way of doing things, but for SUnit 4.0 (2009 or so) he added <br>
#assert:equals:.<br>
<br>
Niall's code did not specify which argument is the expected
and which <br>
the actual. The failure description just says "a is not equal
to b." So <br>
it was left ambiguous.<br>
<br>
However, I was never in doubt that the "proper" usage was
"assert: <br>
actual equals: expected." And there's quite a lot of Smalltalk
code that <br>
uses it that way. A random sampling of GemStone's many tests
shows <br>
exactly none that put the expected value first. And Pharo
explicitly <br>
shows which is which, their message pattern in TestAsserter is<br>
<br>
assert: actual equals: expected<br>
<br>
and their tests follow that usage.<br>
<br>
So, since "we all expect the actual to be first" and there's a
quite lot <br>
of code in Smalltalk-land that agrees with that, I'd suggest
that Cuis <br>
follow suit.<br>
<br>
Regards,<br>
-Martin<br>
<br>
<br>
On 7/23/23 19:29, Hernán Wilkinson via Cuis-dev wrote:<br>
> Hi Hilaire<br>
> I think all of us that used #assert:equals: had the same
feeling as <br>
> you someday.<br>
> We all expect the actual to be first, but for some
reason I do not <br>
> know Kent Beck put the expected first when he wrote SUnit
and all the <br>
> descendant testing framework followed that convention
(JUnit, NUnit, <br>
> phpunit, etc etc).<br>
> We should not change it for historical and compatibility
reasons.<br>
> Adding the message you suggest will not harm, but it is
redundant...<br>
> My advice, give it a couple of days, you will get used
to it to put <br>
> the expected first, it is a matter of time.<br>
><br>
<br>
</blockquote>
</div>
<br clear="all">
<div><br>
</div>
<span class="gmail_signature_prefix">-- </span><br>
<div dir="ltr" class="gmail_signature">
<div dir="ltr">
<div>
<div dir="ltr">
<div style="font-size: small;">
<div dir="ltr">
<div dir="ltr">
<div style="font-size: 12.8px;"><span
style="font-family: tahoma,sans-serif;
font-size: xx-small; border-collapse: collapse;"><strong><span
style="font-size: 8pt;"><span
style="font-size: small;"><font size="2"><span
style="font-weight: normal;"><span
style="font-weight: bold;">Hernán
Wilkinson</span><br>
Agile Software Development, Teaching
& Coaching</span></font></span></span></strong></span></div>
<div style="font-size: 12.8px;"><span
style="font-family: tahoma,sans-serif;
font-size: xx-small; border-collapse: collapse;"><strong><span
style="font-size: 8pt;"><span
style="font-size: small;"><font size="2"><span
style="font-weight: normal;">Phone:
+54-011</span></font></span></span></strong></span><font
size="2" face="tahoma, sans-serif">-4893-2057</font></div>
<div style="font-size: 12.8px;"><strong
style="font-family: tahoma,sans-serif;
font-size: xx-small;"><span style="font-size:
8pt;"><span style="font-size: small;"><font
size="2"><span style="font-weight:
normal;">Twitter: @HernanWilkinson</span></font></span></span></strong></div>
<div style="font-size: 12.8px;"><span
style="font-family: tahoma,sans-serif;
font-size: xx-small; border-collapse: collapse;"><strong><span
style="font-size: 8pt;"><span
style="font-size: small;"><font size="2"><span
style="font-weight: normal;">site: <a
moz-do-not-send="true"
href="http://www.10pines.com/"
style="color: rgb(17, 65, 112);"
target="_blank">http://www.10Pines.com</a></span></font></span></span></strong></span></div>
<div style="font-size: 12.8px;"><font face="tahoma,
sans-serif"><span style="border-collapse:
collapse;">Address: Alem 896</span></font>,
Floor 6, Buenos Aires, Argentina</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
<br>
<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>