[squeak-dev] The Trunk: CollectionsTests-ar.151.mcz

commits at source.squeak.org commits at source.squeak.org
Fri Mar 5 04:34:09 UTC 2010


Andreas Raab uploaded a new version of CollectionsTests to project The Trunk:
http://source.squeak.org/trunk/CollectionsTests-ar.151.mcz

==================== Summary ====================

Name: CollectionsTests-ar.151
Author: ar
Time: 4 March 2010, 8:33:57.891 pm
UUID: 3995d062-0a33-6b42-a08d-d56ed2c72396
Ancestors: CollectionsTests-ar.150

Add tests for at:ifPresent:ifAbsent: (illustrating a bug in the implementation).

=============== Diff against CollectionsTests-ar.150 ===============

Item was added:
+ ----- Method: DictionaryTest>>testAtIfPresentIfAbsent (in category 'basic tests') -----
+ testAtIfPresentIfAbsent
+ 	"Test at:ifPresent:ifAbsent:"
+ 	| dict present absent |
+ 	dict := Dictionary new.
+ 	present := absent := false.
+ 	dict at: #foo ifPresent:[:v| present := true] ifAbsent:[absent := true].
+ 	self deny: present.
+ 	self assert: absent.
+ 
+ 	dict at: #foo put: #bar.
+ 	present := absent := false.
+ 	dict at: #foo ifPresent:[:v| present := true] ifAbsent:[absent := true].
+ 	self assert: present.
+ 	self deny: absent.
+ 
+ 	present := absent := false.
+ 	dict at: #foo ifPresent:[:v| present := true. nil] ifAbsent:[absent := true].
+ 	self assert: present.
+ 	self deny: absent.
+ !




More information about the Squeak-dev mailing list