<div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000">
Hi all!<div><br></div><div>Any idea on how to fix that? #caseError must not be sent to "self" if inlined:</div><div><br></div><div><img id="01bee8ac-4a1d-4356-af49-ee80a3a692d1" src="cid:8cfca4c8-4bf7-44c9-ab78-715b19fe2135" width="auto"></img><br></div><div><br></div><div>Best,</div><div>Marcel</div><div class="mb_sig"></div>
<blockquote class="history_container" type="cite" style="border-left-style: solid;border-width: 1px;margin-top: 20px;margin-left: 0px;padding-left: 10px;min-width: 500px">
<p style="color: #AAAAAA; margin-top: 10px;">Am 17.04.2020 10:00:17 schrieb commits@source.squeak.org <commits@source.squeak.org>:</p><div style="font-family:Arial,Helvetica,sans-serif">Marcel Taeumel uploaded a new version of Tests to project The Trunk:<br>http://source.squeak.org/trunk/Tests-mt.430.mcz<br><br>==================== Summary ====================<br><br>Name: Tests-mt.430<br>Author: mt<br>Time: 17 April 2020, 10:00:04.765586 am<br>UUID: f6a52e06-a24a-ca4b-bbea-8cf479934e4a<br>Ancestors: Tests-ul.429<br><br>First steps to improve CaseErrorTest:<br>- the faulty #printOn: must be in a separate object so that the instance of TestCase can be printed as usual in logs and views<br>- adds #testCaseErrorMessage, which actually documents another bug, which is that #printString in #caseError is called on the wrong object<br><br>I suppose that the idea of having "self printString" in #caseError is that the user learns about the actual cases of the receiver *and not* about the outer-context object that is triggering that case-of in the first place.<br><br>=============== Diff against Tests-ul.429 ===============<br><br>Item was removed:<br>- ----- Method: CaseErrorTest>>printOn: (in category 'tests') -----<br>- printOn: aStream<br>- 3 caseOf: <br>- { [1] -> [aStream nextPutAll: 'option 1'].<br>- [2] -> [aStream nextPutAll: 'option 2'] }<br>- "caseError in printOn:"!<br><br>Item was changed:<br> ----- Method: CaseErrorTest>>testCaseErrorInPrintOn (in category 'tests') -----<br> testCaseErrorInPrintOn<br>+ self should: [ CaseErrorTestObject new printString ] raise: Error!<br>- self should: [ self printString ] raise: Error!<br><br>Item was added:<br>+ ----- Method: CaseErrorTest>>testCaseErrorMessage (in category 'tests') -----<br>+ testCaseErrorMessage<br>+ "Check whether the error message actually includes the printString of the object where #caseOf: is sent to. As of April 17, 2020, the error message actually uses the printString of the outer-contxt receiver, which is wrong. Take a look at Object >> #caseOf:. There is no indication of 'self' not being the receiver of #caseOf:."<br>+ <br>+ ['my message' caseOf: { [1] -> ['option 1'] }]<br>+ on: Error<br>+ do: [:error | self assert: (error messageText includesSubstring: 'my message' printString)].!<br><br>Item was added:<br>+ Object subclass: #CaseErrorTestObject<br>+ instanceVariableNames: ''<br>+ classVariableNames: ''<br>+ poolDictionaries: ''<br>+ category: 'Tests-Bugs'!<br><br>Item was added:<br>+ ----- Method: CaseErrorTestObject>>printOn: (in category 'printing') -----<br>+ printOn: aStream<br>+ 3 caseOf: <br>+ { [1] -> [aStream nextPutAll: 'option 1'].<br>+ [2] -> [aStream nextPutAll: 'option 2'] }<br>+ "caseError in printOn:"!<br><br><br></div></blockquote></div>