[BUG][FIX] WeakKeyDictionary>>keysAndValuesDo: ([er][et] could
probably go in 3.8alpha?)
Doug Way
dway at mailcan.com
Thu Jul 15 18:11:22 UTC 2004
On Thursday, July 15, 2004, at 12:25 PM, Andrew P. Black wrote:
> ...
> I ran the following (slightly modified, as suggested by Doug) test in
> a 3.7beta image both with and without my Association refactoring.
>
> testNoNils
> | d foundNil |
> foundNil _ false.
> d _ WeakIdentityKeyDictionary new
> at: 'hello' copy put: 'world';
> yourself.
> Smalltalk garbageCollectMost.
> d keysAndValuesDo: [ : k : v | k ifNil: [ foundNil ] ].
> self deny: foundNil
>
> The test PASSED in BOTH cases. This is because the critical line
> should read:
>
> d keysAndValuesDo: [ : k : v | k ifNil: [ foundNil _ true ] ].
>
> OOPS!
>
> With this fix,the test indeed fails before the patch is installed, and
> passes afterwards.
Oops, indeed. :) I guess I was using Chris' earlier workspace doit
test rather than running the SUnit test to see whether it worked or
not, so I missed this. I'll make sure this fix gets in as the approved
test.
- Doug
More information about the Squeak-dev
mailing list
|