[squeak-dev] The Inbox: CollectionsTests-jr.320.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Sep 25 13:41:24 UTC 2019


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"!



More information about the Squeak-dev mailing list