<div dir="auto"><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Mar 25, 2018 3:56 PM, "Eliot Miranda" <<a href="mailto:eliot.miranda@gmail.com">eliot.miranda@gmail.com</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Chris,<div class="gmail_extra"><br><div class="gmail_quote"><div class="quoted-text">On Sun, Mar 25, 2018 at 1:51 PM,  <span dir="ltr"><<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">Chris Cunningham uploaded a new version of KernelTests to project The Trunk:<br>
<a href="http://source.squeak.org/trunk/KernelTests-cbc.336.mcz" rel="noreferrer" target="_blank">http://source.squeak.org/trunk<wbr>/KernelTests-cbc.336.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: KernelTests-cbc.336<br>
Author: cbc<br>
Time: 25 March 2018, 1:51:33.345291 pm<br>
UUID: 6e6b91ac-d706-8f4d-bd60-105710<wbr>9994cb<br>
Ancestors: KernelTests-eem.335<br>
<br>
Test that new xor: takes blocks - but only those that result in booleans.  Others raise errors.<br>
<br>
=============== Diff against KernelTests-eem.335 ===============<br>
<br>
Item was changed:<br>
  ----- Method: FalseTest>>testXor (in category 'tests') -----<br>
  testXor<br>
        self assert: (false xor: true) = true.<br>
        self assert: (false xor: false) = false.<br>
+       self assert: (false xor: [true]) = true.<br>
+       self assert: (false xor: [false]) = false.<br>
+       self should: [false xor: [1]] raise: NonBooleanReceiver.!<br></blockquote><div><br></div></div><div>Shouldn't "false xor: 1" also raise an error?  </div></div></div></div></blockquote></div></div></div><div dir="auto">Yes it will. I will put a check for that in I'd it makes sense. </div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>I don't see why "false xor: [1]" should raise NonBooleanReceiver specifically.</div></div></div></div></blockquote></div></div></div><div dir="auto">That isn't ideal. It is a result of the implementation - ifTrue:ifFalse: is sent to the (value of the) argument which is then the "receiver" at that point and isn't an boolean.</div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>  It should raise an error, but whether [1] or 1 becomes the receiver internally to xor: seems to me an implementation detail.  Surely the receiver in "false xor: [1]" is false and that ids a boolean, so NonBooleanReceiver is an unintuitive error foBoolean.</div></div></div></div></blockquote></div></div></div><div dir="auto">Yes but trapping this and making it more intuitive would make the xor: logic even more complex. </div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div class="quoted-text"><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex">
-<br>
-       self<br>
-               should: [(false xor: [false])<br>
-                       ifTrue: ["This should never be true, do not signal an Error and let the test fail"]<br>
-                       ifFalse: [self error: 'OK, this should be false, raise an Error']]<br>
-               raise: Error<br>
-               description: 'a Block argument is not allowed. If it were, answer would be false'.!<br>
<br>
Item was changed:<br>
  ----- Method: TrueTest>>testXor (in category 'testing') -----<br>
  testXor<br>
        self assert: (true xor: true) = false.<br>
        self assert: (true xor: false) = true.<br>
+       self assert: (true xor: [true]) = false.<br>
+       self assert: (true xor: [false]) = true.<br>
+       self should: [true xor: [1]] raise: NonBooleanReceiver.!<br>
-<br>
-       self<br>
-               should: [(true xor: [true])<br>
-                       ifTrue: ["This should never be true, do not signal an Error and let the test fail"]<br>
-                       ifFalse: [self error: 'OK, this should be false, raise an Error']]<br>
-               raise: Error<br>
-               description: 'a Block argument is not allowed. If it were, answer would be false'.!<br>
<br>
<br>
</blockquote></div></div><font color="#888888"><br><br clear="all"><div><br></div>-- <br><div class="m_6132598264800054489gmail_signature"><div dir="ltr"><div><span style="font-size:small;border-collapse:separate"><div>_,,,^..^,,,_<br></div><div>best, Eliot</div></span></div></div></div>
</font></div></div>
<br><br>
<br></blockquote></div><br></div></div></div>