[squeak-dev] The Trunk: KernelTests-mt.408.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Nov 18 09:47:39 UTC 2021


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]).!



More information about the Squeak-dev mailing list