Levente Uzonyi uploaded a new version of Tests to project The Trunk:
http://source.squeak.org/trunk/Tests-ul.50.mcz==================== Summary ====================
Name: Tests-ul.50
Author: ul
Time: 28 February 2010, 7:22:44.839 pm
UUID: 9ec80f2d-29ec-8040-8951-93066acefcd1
Ancestors: Tests-nice.49
- integrity tests for Dictionaries (except for WeakKeyDictionaries, because those state may change while the tests are running)
=============== Diff against Tests-nice.49 ===============
Item was added:
+ TestCase subclass: #DictionaryIntegrityTest
+ instanceVariableNames: ''
+ classVariableNames: ''
+ poolDictionaries: ''
+ category: 'Tests-Bugs'!
Item was added:
+ ----- Method: DictionaryIntegrityTest>>testMethodDictionaries (in category 'tests') -----
+ testMethodDictionaries
+
+ MethodDictionary allInstancesDo: [ :dictionary |
+ dictionary keysAndValuesDo: [ :key :value |
+ self assert: (dictionary at: key) == value ].
+ 1 to: dictionary basicSize do: [ :index |
+ (dictionary basicAt: index)
+ ifNil: [ self assert: (dictionary array at: index) isNil ]
+ ifNotNil: [ :key |
+ self assert: (dictionary scanFor: key) = index ] ] ]!
Item was added:
+ ----- Method: DictionaryIntegrityTest>>testDictionaries (in category 'tests') -----
+ testDictionaries
+
+ #(
+ Dictionary
+ IdentityDictionary
+ SystemDictionary
+ LiteralDictionary
+ PluggableDictionary
+ WeakValueDictionary) do: [ :dictionaryClassName |
+ Smalltalk at: dictionaryClassName ifPresent: [ :dictionaryClass |
+ dictionaryClass allInstancesDo: [ :dictionary |
+ dictionary keysAndValuesDo: [ :key :value |
+ self assert: (dictionary at: key) == value ].
+ dictionary array doWithIndex: [ :association :index |
+ association ifNotNil: [
+ self assert: (dictionary scanFor: association key) = index ] ] ] ] ]!