The Inbox: CollectionsTests-jr.320.mcz

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

The Inbox: CollectionsTests-jr.320.mcz

commits-2
A new version of CollectionsTests was added to project The Inbox:
http://source.squeak.org/inbox/CollectionsTests-jr.320.mcz

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

Name: CollectionsTests-jr.320
Author: jr
Time: 25 September 2019, 3:41:23.707261 pm
UUID: 54df98c0-c984-3b45-b189-dc267b743422
Ancestors: CollectionsTests-dtl.318

Add test for change in Collections-jr.855

=============== Diff against CollectionsTests-dtl.318 ===============

Item was added:
+ ClassTestCase subclass: #WeakKeyDictionaryTest
+ instanceVariableNames: ''
+ classVariableNames: ''
+ poolDictionaries: ''
+ category: 'CollectionsTests-Weak'!

Item was added:
+ ----- Method: WeakKeyDictionaryTest>>testNilDoesNotInheritValueOfGarbageCollectedObject (in category 'tests') -----
+ testNilDoesNotInheritValueOfGarbageCollectedObject
+ "When the keys are garbage collected, they become nil in the associations.
+ This must not mislead the dictionary to answer that nil had one of the values of these
+ associations!!"
+ | dictionary hashTable |
+ dictionary := self targetClass new.
+ "Craft a hash table where all keys were freed."
+ hashTable := dictionary array.
+ self assert: hashTable size > 0.
+ hashTable replace: [:each | WeakKeyAssociation key: nil value: 1].
+ self assert: (dictionary at: nil ifAbsent: []) isNil. "and not 1"!