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

commits at source.squeak.org commits at source.squeak.org
Fri Nov 13 06:01:08 UTC 2009


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

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

Name: CollectionsTests-ar.110
Author: ar
Time: 12 November 2009, 10:00:25 am
UUID: 82573446-f476-f74a-835c-4b50cbbfdf29
Ancestors: CollectionsTests-ul.109

Illustrate a bug in handling collisions with nil keys in Dictionary.

=============== Diff against CollectionsTests-ul.109 ===============

Item was added:
+ ----- Method: DictionaryTest>>testNilHashCollision (in category 'tests') -----
+ testNilHashCollision
+ 	"Ensures that fixCollisionsFrom: does the right thing in the presence of a nil key"
+ 	| dict key |
+ 	dict := Dictionary new.
+ 	key := nil hash. "any key with same hash as nil"
+ 	dict at: key hash put: 1.
+ 	dict at: nil put: 2.
+ 	self assert: (dict includesKey: nil).
+ 	dict removeKey: key.
+ 	self assert: (dict includesKey: nil).
+ !




More information about the Squeak-dev mailing list