The Trunk: CollectionsTests-ar.110.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: CollectionsTests-ar.110.mcz

commits-2
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).
+ !