[squeakdev] The Trunk: KernelTestsmt.408.mcz
Marcel Taeumel
marcel.taeumel at hpi.de
Tue Nov 23 10:49:07 UTC 2021
Hi Christoph 
Okay. But please do not use literals as the receiver of #caseOf:(otherwise:). Those are usually variables. Well, except for the special case "true caseOf: ..." maybe document it in a test as well?
Best,
Marcel
Am 22.11.2021 17:15:50 schrieb christoph.thiede at student.hpi.unipotsdam.de <christoph.thiede at student.hpi.unipotsdam.de>:
Hi Marcel,
> @Christoph(ct): Please simplify the b's and the c's as discussed here: http://lists.squeakfoundation.org/pipermail/squeakdev/2020March/207963.html
given the complexity of compiler inlinings, I would feel more safe if we kept all three assertions at least for the '*Inlined' tests. Then again, the tests would look more uniform if we also kept all assertions in their noninlined pendants. What do you think? :)
Best,
Christoph

Sent from Squeak Inbox Talk [https://github.com/hpiswalab/squeakinboxtalk]
On 20211118T09:47:39+00:00, commits at source.squeak.org wrote:
> Marcel Taeumel uploaded a new version of KernelTests to project The Trunk:
> http://source.squeak.org/trunk/KernelTestsmt.408.mcz
>
> ==================== Summary ====================
>
> Name: KernelTestsmt.408
> Author: mt
> Time: 18 November 2021, 10:47:39.0372 am
> UUID: 43e74627a7697c4285459f999e1d21fb
> Ancestors: KernelTestsmt.407
>
> Complements Kernelmt.1422
>
> @Christoph(ct): Please simplify the b's and the c's as discussed here: http://lists.squeakfoundation.org/pipermail/squeakdev/2020March/207963.html
>
> =============== Diff against KernelTestsmt.407 ===============
>
> Item was added:
> +  Method: ObjectTest>>testCaseOf (in category 'tests') 
> + testCaseOf
> +
> +  a b c dict 
> + a := Object new.
> + b := Object new.
> + c := Object new.
> + dict := {
> + [a] > [b].
> + [b] > [c].
> + [c] > [a] }.
> + self assert: b equals: (a caseOf: dict).
> + self assert: c equals: (b caseOf: dict).
> + self assert: a equals: (c caseOf: dict).
> + self should: [nil caseOf: dict] raise: Error.!
>
> Item was added:
> +  Method: ObjectTest>>testCaseOfInlined (in category 'tests') 
> + testCaseOfInlined
> +
> +  a b c 
> + a := Object new.
> + b := Object new.
> + c := Object new.
> + self assert: b equals: (a caseOf: { [a] > [b]. [b] > [c]. [c] > [a] }).
> + self assert: c equals: (b caseOf: { [a] > [b]. [b] > [c]. [c] > [a] }).
> + self assert: a equals: (c caseOf: { [a] > [b]. [b] > [c]. [c] > [a] }).
> + self should: [nil caseOf: { [a] > [b]. [b] > [c]. [c] > [a] }] raise: Error.!
>
> Item was added:
> +  Method: ObjectTest>>testCaseOfOtherwise (in category 'tests') 
> + testCaseOfOtherwise
> +
> +  a b c dict 
> + a := Object new.
> + b := Object new.
> + c := Object new.
> + dict := {
> + [a] > [b].
> + [b] > [c].
> + [c] > [a] }.
> +
> + self assert: b equals: (a caseOf: dict otherwise: [self fail]).
> + self assert: c equals: (b caseOf: dict otherwise: [self fail]).
> + self assert: a equals: (c caseOf: dict otherwise: [self fail]).
> + self assert: 42 equals: (nil caseOf: dict otherwise: [42]).
> + self assert: 42 equals: (6 caseOf: dict otherwise: [:x  x * 7]).!
>
> Item was added:
> +  Method: ObjectTest>>testCaseOfOtherwiseInlined (in category 'tests') 
> + testCaseOfOtherwiseInlined
> +
> +  a b c 
> + a := Object new.
> + b := Object new.
> + c := Object new.
> + self assert: b equals: (a caseOf: { [a] > [b]. [b] > [c]. [c] > [a] } otherwise: [self fail]).
> + self assert: c equals: (b caseOf: { [a] > [b]. [b] > [c]. [c] > [a] } otherwise: [self fail]).
> + self assert: a equals: (c caseOf: { [a] > [b]. [b] > [c]. [c] > [a] } otherwise: [self fail]).
> + self assert: 42 equals: (nil caseOf: { [a] > [b]. [b] > [c]. [c] > [a] } otherwise: [42]).
> + self assert: 42 equals: (6 caseOf: { [a] > [b]. [b] > [c]. [c] > [a] } otherwise: [:x  x * 7]).!
>
>
 next part 
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeakdev/attachments/20211123/2aa562a9/attachment.html>
More information about the Squeakdev
mailing list
