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

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


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

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

Name: CollectionsTests-jr.319
Author: jr
Time: 25 September 2019, 3:24:53.304261 pm
UUID: f44f2265-88ab-3042-b84f-bdb5bbd8b8ef
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 objects are garbage collected, the keys in the names hash table become nil.
+ 	This must not mislead the dictionary to answer that nil had one of the values of the former
+ 	objects!!"
+ 	| 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