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

Jakob Reschke forums.jakob at resfarm.de
Wed Sep 25 13:36:51 UTC 2019


Copy&paste glitch in the method's comment... uploading a fixed version with
the same ancestors in a moment. This one should be discarded.

Am Mi., 25. Sept. 2019 um 15:25 Uhr schrieb <commits at source.squeak.org>:

> 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"!
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20190925/be3c1959/attachment.html>


More information about the Squeak-dev mailing list