[squeak-dev] The Trunk: KernelTests-nice.190.mcz
commits at source.squeak.org
commits at source.squeak.org
Sat May 7 12:43:25 UTC 2011
Nicolas Cellier uploaded a new version of KernelTests to project The Trunk:
http://source.squeak.org/trunk/KernelTests-nice.190.mcz
==================== Summary ====================
Name: KernelTests-nice.190
Author: nice
Time: 7 May 2011, 2:42:58.26 pm
UUID: 543a1b09-d95b-409c-9e8a-f6c94fc63fba
Ancestors: KernelTests-nice.189
Test #whichSelectorsStoreInto: and #whichMethodsStoreInto:
The tests use two static classes rather than create them on the fly because this is far more simple.
I did not comment the classes just because I installed OB and didn't find where the hell I could comment.
=============== Diff against KernelTests-nice.189 ===============
Item was added:
+ ----- Method: BehaviorTest>>testWhichMethodsStoreInto (in category 'tests') -----
+ testWhichMethodsStoreInto
+ ClassForBehaviorTest withAllSubclassesDo: [:eachTestClass |
+ {eachTestClass. eachTestClass class} do: [:eachTestClassOrMetaclass |
+
+ eachTestClassOrMetaclass allInstVarNames do: [:iv |
+ self assert: ((eachTestClassOrMetaclass whichMethodsStoreInto: iv)
+ collect: [:eachMethod | eachMethod selector]) sorted
+ = (eachTestClassOrMetaclass whichSelectorsStoreInto: iv) sorted.
+ self assert: ((eachTestClassOrMetaclass whichMethodsStoreInto: iv)
+ allSatisfy: [:eachMethod | eachMethod methodClass = eachTestClassOrMetaclass]) ].
+
+ eachTestClassOrMetaclass allClassVarNames do: [:cv |
+ self assert: ((eachTestClassOrMetaclass whichMethodsStoreInto: cv)
+ collect: [:eachMethod | eachMethod selector]) sorted
+ = (eachTestClassOrMetaclass whichSelectorsStoreInto: cv) sorted.
+ self assert: ((eachTestClassOrMetaclass whichMethodsStoreInto: cv)
+ allSatisfy: [:eachMethod | eachMethod methodClass = eachTestClassOrMetaclass]) ]]]!
Item was added:
+ ----- Method: BehaviorTest>>testWhichSelectorStoreInto (in category 'tests') -----
+ testWhichSelectorStoreInto
+ self assert: (ClassForBehaviorTest whichSelectorsStoreInto: 'iv1') sorted = #(#initialize #iv1: #reset ).
+ self assert: (ClassForBehaviorTest whichSelectorsStoreInto: 'iv2') sorted = #(#iv2: #reset ).
+ self assert: (ClassForBehaviorTest whichSelectorsStoreInto: 'CV1') sorted = #(#initialize).
+ self assert: (ClassForBehaviorTest whichSelectorsStoreInto: 'CV2') sorted = #().
+
+ self assert: (SubClassForBehaviorTest whichSelectorsStoreInto: 'iv1') sorted = #(#resetIV1 ).
+ self assert: (SubClassForBehaviorTest whichSelectorsStoreInto: 'iv2') sorted = #(#iv2: ).
+ self assert: (SubClassForBehaviorTest whichSelectorsStoreInto: 'CV1') sorted = #().
+ self assert: (SubClassForBehaviorTest whichSelectorsStoreInto: 'CV2') sorted = #().
+
+ self assert: (ClassForBehaviorTest class whichSelectorsStoreInto: 'CV1') sorted = #(#initialize).
+ self assert: (ClassForBehaviorTest class whichSelectorsStoreInto: 'CV2') sorted = #(#initialize).
+ self assert: (ClassForBehaviorTest class whichSelectorsStoreInto: 'civ1') sorted = #(#civ1).
+
+ self assert: (SubClassForBehaviorTest class whichSelectorsStoreInto: 'CV1') sorted = #().
+ self assert: (SubClassForBehaviorTest class whichSelectorsStoreInto: 'CV2') sorted = #().
+ self assert: (SubClassForBehaviorTest class whichSelectorsStoreInto: 'civ1') sorted = #(#install).!
Item was added:
+ Object subclass: #ClassForBehaviorTest
+ instanceVariableNames: 'iv1 iv2'
+ classVariableNames: 'CV1 CV2'
+ poolDictionaries: ''
+ category: 'KernelTests-Classes'!
+ ClassForBehaviorTest class
+ instanceVariableNames: 'civ1'!
+ ClassForBehaviorTest class
+ instanceVariableNames: 'civ1'!
Item was added:
+ ----- Method: ClassForBehaviorTest class>>civ1 (in category 'accessing') -----
+ civ1
+ ^civ1 ifNil: [civ1 := false]!
Item was added:
+ ----- Method: ClassForBehaviorTest class>>initialize (in category 'class initialization') -----
+ initialize
+ CV1 := 1.
+ CV2 := 2!
Item was added:
+ ----- Method: ClassForBehaviorTest>>initialize (in category 'accessing') -----
+ initialize
+ iv1 := CV1 ifNil: [CV1 := 1]!
Item was added:
+ ----- Method: ClassForBehaviorTest>>iv1 (in category 'accessing') -----
+ iv1
+ ^iv1!
Item was added:
+ ----- Method: ClassForBehaviorTest>>iv1: (in category 'accessing') -----
+ iv1: anyObject
+ iv1 := anyObject!
Item was added:
+ ----- Method: ClassForBehaviorTest>>iv2 (in category 'accessing') -----
+ iv2
+ ^iv2!
Item was added:
+ ----- Method: ClassForBehaviorTest>>iv2: (in category 'accessing') -----
+ iv2: anyObject
+ iv2 := anyObject!
Item was added:
+ ----- Method: ClassForBehaviorTest>>reset (in category 'accessing') -----
+ reset
+ iv1 := iv2 := nil!
Item was added:
+ ClassForBehaviorTest subclass: #SubClassForBehaviorTest
+ instanceVariableNames: 'iv3'
+ classVariableNames: 'CV3'
+ poolDictionaries: ''
+ category: 'KernelTests-Classes'!
Item was added:
+ ----- Method: SubClassForBehaviorTest class>>install (in category 'accessing') -----
+ install
+ civ1 := true!
Item was added:
+ ----- Method: SubClassForBehaviorTest>>iv2: (in category 'accessing') -----
+ iv2: anyObject
+ iv2 := anyObject printString!
Item was added:
+ ----- Method: SubClassForBehaviorTest>>resetIV1 (in category 'accessing') -----
+ resetIV1
+ iv1 := nil!
More information about the Squeak-dev
mailing list
|