[squeak-dev] The Trunk: KernelTests-mt.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.uni-potsdam.de <christoph.thiede at student.hpi.uni-potsdam.de>:
Hi Marcel,

> @Christoph(ct): Please simplify the b's and the c's as discussed here: http://lists.squeakfoundation.org/pipermail/squeak-dev/2020-March/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 non-inlined pendants. What do you think? :-)

Best,
Christoph

---
Sent from Squeak Inbox Talk [https://github.com/hpi-swa-lab/squeak-inbox-talk]

On 2021-11-18T09: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/KernelTests-mt.408.mcz
>
> ==================== Summary ====================
>
> Name: KernelTests-mt.408
> Author: mt
> Time: 18 November 2021, 10:47:39.0372 am
> UUID: 43e74627-a769-7c42-8545-9f999e1d21fb
> Ancestors: KernelTests-mt.407
>
> Complements Kernel-mt.1422
>
> @Christoph(ct): Please simplify the b's and the c's as discussed here: http://lists.squeakfoundation.org/pipermail/squeak-dev/2020-March/207963.html
>
> =============== Diff against KernelTests-mt.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/squeak-dev/attachments/20211123/2aa562a9/attachment.html>


More information about the Squeak-dev mailing list