diff --git a/README.markdown b/README.markdown index 27662f5..a108de6 100644 --- a/README.markdown +++ b/README.markdown @@ -63,17 +63,20 @@ Ok, have at it! * TestSortedCollection * TestBag * TestAssociation -\* TestDictionary +* TestDictionary * TestSet * TestBlock * TestCollectionsRevisited -\* TestIteration -\* TestBoolean -\* TestException +* TestIteration +* TestBoolean +* TestException * TestRegex -\* TestClass -\* TestClassHierarchy -\* TestMetaclass +* TestClass + +### Koans that still need to be written + +* TestClassHierarchy +* TestMetaclass ### Pull Requests and Feedback are Welcome! @@ -91,7 +94,9 @@ There is no set time, but I plan to port these koans over to the following Small * redline? * Jtalk? -### Credits +### Inspiration and Credits + +GNU Smalltalk Koans were inspired by Edgecase's Ruby Koans and Aaron Bedra's Clojure Koans (now maintained by Colin Jones). Thanks to [Matt Yoho](http://twitter.com/#!/mattyoho) of the Ruby Koans team for letting me port some of the koans over. diff --git a/src/koans/TestArray.st b/src/koans/TestArray.st index e802fc7..557807f 100644 --- a/src/koans/TestArray.st +++ b/src/koans/TestArray.st @@ -47,7 +47,7 @@ Koan subclass: TestArray [ array := Array with: 2 with: 4 with: 6 with: 8 with: 10. self expect: (self fillMeIn) toEqual: (array). - self expect: [Array with: 1 with: 3 with: 5 with: 7 with: 9 with: 11] toRaise: (self fillMeIn). + self expect: [ Array with: 1 with: 3 with: 5 with: 7 with: 9 with: 11 ] toRaise: (self fillMeIn). ] testReplaceValueAtElement [ @@ -64,7 +64,7 @@ Koan subclass: TestArray [ array := #('a' 'b' 'c'). - self expect: [array at: 1 put: 'd'] toRaise: (self fillMeIn). + self expect: [ array at: 1 put: 'd' ] toRaise: (self fillMeIn). "#() only accepts literal values." ] diff --git a/src/koans/TestAssociation.st b/src/koans/TestAssociation.st index 3a42419..e723cca 100644 --- a/src/koans/TestAssociation.st +++ b/src/koans/TestAssociation.st @@ -1,4 +1,6 @@ Koan subclass: TestAssociation [ + + testCreatingAssociationThreeDifferentWays [ | association anotherAssociation andAnotherAssociation | diff --git a/src/koans/TestBag.st b/src/koans/TestBag.st index b1deb18..78e7f8d 100644 --- a/src/koans/TestBag.st +++ b/src/koans/TestBag.st @@ -21,7 +21,7 @@ Koan subclass: TestBag [ bag add: 1 withOccurrences: 3. bag add: 2. - self expect: [bag at: 1] toRaise: (self fillMeIn). + self expect: [ bag at: 1 ] toRaise: (self fillMeIn). ] testComparingBags [ diff --git a/src/koans/TestBlock.st b/src/koans/TestBlock.st index 529b388..5af6e47 100644 --- a/src/koans/TestBlock.st +++ b/src/koans/TestBlock.st @@ -66,7 +66,7 @@ Koan subclass: TestBlock [ block := [ :x | x ]. - self expect: [block value: 1 value: 2] toRaise: (self fillMeIn). + self expect: [ block value: 1 value: 2 ] toRaise: (self fillMeIn). ] testIterateUsingInterval [ @@ -116,7 +116,7 @@ Koan subclass: TestBlock [ block := []. self expect: (self fillMeIn) toEqual: (block cull: 1). - self expect: [block value: 1] toRaise: (self fillMeIn). + self expect: [ block value: 1 ] toRaise: (self fillMeIn). ] testEachBlockIsAUniqueObject [ diff --git a/src/koans/TestBoolean.st b/src/koans/TestBoolean.st index d354d54..f54cb57 100644 --- a/src/koans/TestBoolean.st +++ b/src/koans/TestBoolean.st @@ -1,17 +1,72 @@ Koan subclass: TestBoolean [ - testIfTrueAndIfFalse [ - | result anotherResult | - - (1 < 2) - ifTrue: [ result := true ] - ifFalse: [ result := false ]. - ((5 + 2 * 9) < 25 ) - ifTrue: [ anotherResult := true ] - ifFalse: [ anotherResult := false ]. - - self expect: (self fillMeIn) toEqual: (result). - self expect: (self fillMeIn) toEqual: (anotherResult). + truthValue: condition [ + condition ifTrue: [ ^#trueStuff ]. + condition ifFalse: [ ^#falseStuff ]. + ] + + testTrueIsTreatedAsTrue [ + self expect: (self fillMeIn) toEqual: (self truthValue: true). + ] + + testFalseIsTreatedAsFalse [ + self expect: (self fillMeIn) toEqual: (self truthValue: false). + ] + + testNilIsNotTreatedAsABoolean [ + self expect: [ self truthValue: nil ] toRaise: (self fillMeIn). + ] + + testIfTrueAndIfFalseOnlyRespondsToBooleans [ + self expect: [ self truthValue: 1 ] toRaise: (self fillMeIn). + self expect: [ self truthValue: 0 ] toRaise: (self fillMeIn). + self expect: [ self truthValue: #() ] toRaise: (self fillMeIn). + self expect: [ self truthValue: 'String' ] toRaise: (self fillMeIn). + self expect: [ self truthValue: '' ] toRaise: (self fillMeIn). + ] + + testAndShortCircuit [ + | x y z | + + x := 4. y := 10. z := 0. + + self expect: (self fillMeIn) toEqual: (x < 5 and: [ z := 1. y < 11 ]). + self expect: (self fillMeIn) toEqual: z. + + z := 0. + + self expect: (self fillMeIn) toEqual: (x < 4 and: [ z := 1. y < 11 ]). + self expect: (self fillMeIn) toEqual: z. + + "How is this different from '&'?" + ] + + testOrShortCircuit [ + | x y z | + + x := 4. y := 10. z := 0. + + self expect: (self fillMeIn) toEqual: (x > 5 or: [ z := 1. y > 9]). + self expect: (self fillMeIn) toEqual: z. + + z := 0. + + self expect: (self fillMeIn) toEqual: (x > 9 sqrt or: [ z := 1. y > 9]). + self expect: (self fillMeIn) toEqual: z. + ] + + testEqv [ + self expect: (self fillMeIn) toEqual: (true eqv: true). + self expect: (self fillMeIn) toEqual: (true eqv: false). + self expect: (self fillMeIn) toEqual: (false eqv: true). + self expect: (self fillMeIn) toEqual: (false eqv: false). + ] + + testXor [ + self expect: (self fillMeIn) toEqual: (true xor: true). + self expect: (self fillMeIn) toEqual: (true xor: false). + self expect: (self fillMeIn) toEqual: (false xor: true). + self expect: (self fillMeIn) toEqual: (false xor: false). ] ] diff --git a/src/koans/TestClass.st b/src/koans/TestClass.st index bf7754d..da738af 100644 --- a/src/koans/TestClass.st +++ b/src/koans/TestClass.st @@ -1,13 +1,90 @@ -Koan subclass: TestClass [ - +Object subclass: HelloWorld [ + + + + Statement := $S. + + | instanceVariable | "Unlike other Smalltalks, method statements are inside brackets." - "Class variables are defined the same as variable assignments." + awesome [ + ^true + ] + + + string [ + ^'Hello ', string + ] - "Pragmas define class comment, class category, imported namespaces, and the shape of indexed instance variables." + say: something [ + ^self class name asString, ' says ', something + ] +] + +HelloWorld subclass: SubHelloWorld [] + +Koan subclass: TestClass [ + + + "Class variables are defined the same as variable assignments." "superclass" "allInstances" "allSuperclasses" + + testName [ + self expect: (self fillMeIn) toEqual: HelloWorld name. + ] + + testPragmas [ + " + Pragmas define: + class comment + class category + imported namespaces + shape of indexed instance variables. + " + + self expect: (self fillMeIn) toEqual: HelloWorld comment. + self expect: (self fillMeIn) toEqual: HelloWorld category. + ] + + testInstanceVariableCollection [ + self expect: (self fillMeIn) toEqual: HelloWorld instVarNames. + ] + + testClassInstanceVariableCollection [ + self expect: (self fillMeIn) toEqual: HelloWorld classVarNames asArray. + ] + + testMessageCollection [ + self expect: (self fillMeIn) toEqual: HelloWorld selectors asArray. + ] + + testSourceCodeAt [ + " + #sourceCodeAt: returns the source code of the specified message. + For example: HelloWorld sourceCodeAt: #+ would return: + + '+ string [ + ^''Hello '', string + ]' + " + ] + + testAllInstances [ + | helloWorld | + + helloWorld := HelloWorld new. + + self expect: (self fillMeIn) toEqual: (HelloWorld allInstances asArray). + ] + + testSuperclass [ + self expect: (self fillMeIn) toEqual: (HelloWorld superclass). + ] + + testAllSubclasses [ + self expect: (self fillMeIn) toEqual: (HelloWorld allSubclasses asArray). + ] ] diff --git a/src/koans/TestClassHierarchy.st b/src/koans/TestClassHierarchy.st index 786dc76..c78fb14 100644 --- a/src/koans/TestClassHierarchy.st +++ b/src/koans/TestClassHierarchy.st @@ -1,6 +1,13 @@ Koan subclass: TestClassHierarchy [ + testSuperclasses [ + self expect: (self fillMeIn) toEqual: (SmallInteger superclass). + self expect: (self fillMeIn) toEqual: (String superclass). + self expect: (self fillMeIn) toEqual: (String superclass). + self expect: (self fillMeIn) toEqual: (True superclass). + ] + testNumberAndMagnitudeAreAbstractClasses [ self expect: (self fillMeIn) toEqual: (1234 isKindOf: Number). self expect: (self fillMeIn) toEqual: (1234 isKindOf: Magnitude). diff --git a/src/koans/TestCollectionsRevisited.st b/src/koans/TestCollectionsRevisited.st index 9cf9c11..16b520a 100644 --- a/src/koans/TestCollectionsRevisited.st +++ b/src/koans/TestCollectionsRevisited.st @@ -157,7 +157,7 @@ Koan subclass: TestCollectionsRevisited [ array := #(0 1 2 3). self expect: (self fillMeIn) toEqual: (array at: 0 ifAbsent: [nil]). - self expect: [array at: 0] toRaise: (self fillMeIn). + self expect: [ array at: 0 ] toRaise: (self fillMeIn). "#at:ifAbsent: also works on OrderedCollection, SortedCollection, and Dictionary." ] @@ -168,6 +168,6 @@ Koan subclass: TestCollectionsRevisited [ orderedCollection := OrderedCollection new addAll: #(0 1 2 3); yourself. self expect: (self fillMeIn) toEqual: (orderedCollection remove: 4 ifAbsent: [nil]). - self expect: [orderedCollection remove: 4] toRaise: (self fillMeIn). + self expect: [ orderedCollection remove: 4 ] toRaise: (self fillMeIn). ] ] diff --git a/src/koans/TestDictionary.st b/src/koans/TestDictionary.st index e7651ed..f553a82 100644 --- a/src/koans/TestDictionary.st +++ b/src/koans/TestDictionary.st @@ -1,4 +1,6 @@ Koan subclass: TestDictionary [ + + testCreatingANewDictionary [ | dictionary | @@ -11,13 +13,13 @@ Koan subclass: TestDictionary [ testAddingKeysAndValuesUsingAssociations [ | dictionary | - dictionary := Dictionary new. - dictionary - add: #a -> 1; - add: 'b' -> 2; - add: 100 -> 3; - add: true -> 4; - add: nil -> 5. + dictionary := Dictionary new + add: #a -> 1; + add: 'b' -> 2; + add: 100 -> 3; + add: true -> 4; + add: nil -> 5; + yourself. self expect: (self fillMeIn) toEqual: (dictionary at: #a). self expect: (self fillMeIn) toEqual: (dictionary at: 'b'). @@ -29,10 +31,10 @@ Koan subclass: TestDictionary [ testAddingAssociationsUsingAtPut [ | dictionary | - dictionary := Dictionary new. - dictionary - at: #a put: 1; - at: #b put: 2. + dictionary := Dictionary new + at: #a put: 1; + at: #b put: 2; + yourself. self expect: (self fillMeIn) toEqual: (dictionary at: #a). self expect: (self fillMeIn) toEqual: (dictionary at: #b). @@ -65,5 +67,104 @@ Koan subclass: TestDictionary [ self expect: (self fillMeIn) toEqual: (dictionary values). self expect: (self fillMeIn) toEqual: (dictionary keys class). self expect: (self fillMeIn) toEqual: (dictionary values class). + + "Why do you think the classes are different?" + ] + + testRemoveKey [ + | dictionary value | + + dictionary := Dictionary new + add: #a -> 1; + add: #b -> 3; + yourself. + + value := dictionary removeKey: #a. + + self expect: (self fillMeIn) toEqual: value. + self expect: (self fillMeIn) toEqual: (dictionary keys). + + self expect: [ dictionary removeKey: #c ] toRaise: (self fillMeIn). + + value := dictionary removeKey: #c ifAbsent: [0]. + + self expect: (self fillMeIn) toEqual: value. + ] + + testIncludesKey [ + | dictionary | + + dictionary := Dictionary new + add: #daft -> 5; + add: #duck -> 55; + yourself. + + self expect: (self fillMeIn) toEqual: (dictionary includesKey: #daft). + self expect: (self fillMeIn) toEqual: (dictionary includesKey: #monk). + self expect: (self fillMeIn) toEqual: (dictionary includesKey: 'daft'). + ] + + testIteratingKeys [ + | dictionary array counter | + + dictionary := Dictionary new + add: #a -> 2; + add: #c -> 4; + add: #e -> 6; + yourself. + array := Array new: dictionary size. + counter := 1. + + dictionary keysDo: [ :key | + array at: counter put: key. + counter := counter + 1. + ]. + + self expect: (self fillMeIn) toEqual: array. + ] + + testIteratingAssociations [ + | dictionary array counter | + + dictionary := Dictionary new + add: #a -> 1; + add: #b -> 2; + add: #c -> 3; + yourself. + array := Array new: dictionary size. + counter := 1. + + dictionary associationsDo: [ :association | + array at: counter put: association. + counter := counter + 1. + ]. + array sort. + + self expect: (self fillMeIn) toEqual: array. + "Be careful how you craft the array." + ] + + testIteratingKeysAndValues [ + | dictionary array counter | + + dictionary := Dictionary new + add: #a -> 1; + add: #b -> 2; + add: #c -> 3; + yourself. + array := Array new: dictionary size. + counter := 1. + + dictionary keysAndValuesDo: [ :key :value | + array at: counter put: (key -> value). + counter := counter + 1. + ]. + + self expect: (self fillMeIn) toEqual: array. + ] + + testSmalltalkDictionary [ + self expect: (self fillMeIn) toEqual: (Smalltalk class). + self expect: (self fillMeIn) toEqual: (Smalltalk isKindOf: Dictionary). ] ] diff --git a/src/koans/TestException.st b/src/koans/TestException.st index 2e5d38e..d62f3e8 100644 --- a/src/koans/TestException.st +++ b/src/koans/TestException.st @@ -1,3 +1,31 @@ Koan subclass: TestException [ + + testHaltAndError [ + self expect: [ self halt ] toRaise: (self fillMeIn). + self expect: [ self error: 'Error' ] toRaise: (self fillMeIn). + + "All classes have halt and error messages." + ] + + testSignal [ + self expect: [ Exception signal ] toRaise: (self fillMeIn). + self expect: [ Exception signal: 'Hello World' ] toRaise: (self fillMeIn). + ] + + testCatchingExceptionsWithOnDo [ + | result | + + result := [ nil ifTrue: [] ] + on: SystemExceptions.MustBeBoolean + do: [ :e | e return: true ]. + + self expect: (self fillMeIn) toEqual: result. + + result := [ 'Hello' + ' World!' ] + on: MessageNotUnderstood + do: [ :e | e return: true ]. + + self expect: (self fillMeIn) toEqual: result. + ] ] diff --git a/src/koans/TestIteration.st b/src/koans/TestIteration.st index 9d6eb7d..e6174ae 100644 --- a/src/koans/TestIteration.st +++ b/src/koans/TestIteration.st @@ -1,3 +1,35 @@ Koan subclass: TestIteration [ + + testWhileTrue [ + | x y | + + x := 4. y := 1. + + [ x > 0 ] whileTrue: [ x := x - 1. y := y * 2 ]. + + self expect: (self fillMeIn) toEqual: y. + self expect: (self fillMeIn) toEqual: x. + ] + + testWhileFalse [ + | x y | + + x := 0. y := 1. + + [ x >= 4 ] whileFalse: [ x := x + 1. y := y * 2 ]. + + self expect: (self fillMeIn) toEqual: y. + self expect: (self fillMeIn) toEqual: x. + ] + + testTimesRepeat [ + | x y | + + x := 4. y := 2. + + x timesRepeat: [ y := y * 2 ]. + + self expect: (self fillMeIn) toEqual: y. + ] ] diff --git a/src/koans/TestMessage.st b/src/koans/TestMessage.st index d4d23ad..0301d20 100644 --- a/src/koans/TestMessage.st +++ b/src/koans/TestMessage.st @@ -98,7 +98,7 @@ Koan subclass: TestMessage [ self expect: (self fillMeIn) toEqual: value. - "Think about it: we're sending multiple messages to '3'." + "Think about it: we are sending multiple messages to '3'." ] testYourselfIsReferenceToSelf [ @@ -106,12 +106,12 @@ Koan subclass: TestMessage [ "yourself is a reference to self." - object := OrderedCollection new - add: 1; - add: 2. - anotherObject := OrderedCollection new - add: 1; - add: 2; + object := (Array new: 2) + at: 1 put: 'a'; + at: 2 put: 'b'. + anotherObject := (Array new: 2) + at: 1 put: 'a'; + at: 2 put: 'b'; yourself. self expect: (self fillMeIn) toEqual: (object class). diff --git a/src/koans/TestNumber.st b/src/koans/TestNumber.st index 8b1a650..1f86932 100644 --- a/src/koans/TestNumber.st +++ b/src/koans/TestNumber.st @@ -32,4 +32,16 @@ Koan subclass: TestNumber [ self expect: (self fillMeIn) toEqual: (10 min: 5). self expect: (self fillMeIn) toEqual: (20 max: 15). ] + + testPositiveAndNegative [ + self expect: (self fillMeIn) toEqual: (5 positive). + self expect: (self fillMeIn) toEqual: (-5 negative). + self expect: (self fillMeIn) toEqual: (5 strictlyPositive). + self expect: (self fillMeIn) toEqual: (0 strictlyPositive). + ] + + testEvenAndOdd [ + self expect: (self fillMeIn) toEqual: (2 even). + self expect: (self fillMeIn) toEqual: (1 odd). + ] ] diff --git a/src/koans/TestObject.st b/src/koans/TestObject.st index 520539c..c84d8ba 100644 --- a/src/koans/TestObject.st +++ b/src/koans/TestObject.st @@ -16,7 +16,7 @@ Koan subclass: TestObject [ ] testNilObjectCannotBeConvertedToString [ - self expect: [nil asString] toRaise: (self fillMeIn). + self expect: [ nil asString ] toRaise: (self fillMeIn). ] testObjectsCanBeInspected [ diff --git a/src/koans/TestOrderedCollection.st b/src/koans/TestOrderedCollection.st index 4c4b322..14a4ee8 100644 --- a/src/koans/TestOrderedCollection.st +++ b/src/koans/TestOrderedCollection.st @@ -21,7 +21,7 @@ Koan subclass: TestOrderedCollection [ orderedCollection := OrderedCollection with: $a with: $b with: $c with: $d with: $e. self expect: (self fillMeIn) toEqual: (orderedCollection). - self expect: [OrderedCollection with: 'a' with: 'b' with: 'c' with: 'd' with: 'e' with: 'f'] toRaise: (self fillMeIn). + self expect: [ OrderedCollection with: 'a' with: 'b' with: 'c' with: 'd' with: 'e' with: 'f' ] toRaise: (self fillMeIn). "OrderedCollection responds to most messages that Array responds to." ] diff --git a/src/koans/TestString.st b/src/koans/TestString.st index fc43961..b7dccad 100644 --- a/src/koans/TestString.st +++ b/src/koans/TestString.st @@ -26,7 +26,7 @@ Koan subclass: TestString [ self expect: (self fillMeIn) toEqual: string. "Concatenation does not quite work this way..." - self expect: ['Hello ' + 'World'] toRaise: (self fillMeIn). + self expect: [ 'Hello ' + 'World' ] toRaise: (self fillMeIn). ] testStringConcatenationWillLeaveOriginalStringsUnmodified [ @@ -69,7 +69,7 @@ Koan subclass: TestString [ string := 'Smalltalk'. - self expect: [string copyFrom: 6 to: 10] toRaise: (self fillMeIn). + self expect: [ string copyFrom: 6 to: 10 ] toRaise: (self fillMeIn). ] testSingleCharacterFromString [ diff --git a/src/lib/Koan.st b/src/lib/Koan.st index f80c781..93739de 100644 --- a/src/lib/Koan.st +++ b/src/lib/Koan.st @@ -20,15 +20,23 @@ Object subclass: Koan [ ] collections [ - ^{Array . ArrayedCollection . OrderedCollection . SortedCollection . HashCollection . Dictionary . Set . Bag} + ^{Array . WeakArray . ArrayedCollection . OrderedCollection . SortedCollection . HashCollection . IdentityDictionary . Dictionary . IdentitySet . Set . Bag} ] zenMessage [ ^'@dhh > Whoops!' ] + className: value [ + ^value class name asString + ] + + anInstanceOf: value [ + ^' (an instance of ', (self className: value), ')' + ] + prettify: value [ - | prettyValue | + | message | (value = self fillMeIn) ifTrue: [ ^value ]. @@ -42,11 +50,12 @@ Object subclass: Koan [ ]. (value class = Character) ifTrue: [ - ^'$', value asString, ' (an instance of ', value class name, ')' + ^'$', value asString, ' ', (self anInstanceOf: value) ]. (self collections includes: (value class)) ifTrue: [ - ^'#', value displayString, ' (an instance of ', value class name, ')' + message := value displayString replacingRegex: ((self className: value), ' ') with: ''. + ^message, (self anInstanceOf: value) ]. (Exception allSubclasses asArray includes: value) ifTrue: [ @@ -58,9 +67,9 @@ Object subclass: Koan [ ]. (value respondsTo: #asString) ifTrue: [ - ^value asString, ' (an instance of ', value class name, ')' + ^value asString, ' ', (self anInstanceOf: value) ]. - ^'(an instance of ', value class name, ')' + ^self anInstanceOf: value ] diff [ diff --git a/src/lib/Zen.st b/src/lib/Zen.st index 154a2eb..67948e9 100644 --- a/src/lib/Zen.st +++ b/src/lib/Zen.st @@ -38,7 +38,7 @@ Object subclass: Zen [ self testBoolean. self testException. self testRegex. - self testClass. "inheritance, cool methods" + self testClass. self testClassHierarchy. self testMetaclass. "metaprogramming" @@ -106,6 +106,8 @@ Object subclass: Zen [ self tally: #testNegation. self tally: #testRounding. self tally: #testMinMaxOfTwoNumbers. + self tally: #testPositiveAndNegative. + self tally: #testEvenAndOdd. ] testString [ @@ -201,6 +203,12 @@ Object subclass: Zen [ self tally: #testAddingAssociationsUsingAtPut. self tally: #testReplaceValueAtKey. self tally: #testRetrievingCollectionOfKeysAndValues. + self tally: #testRemoveKey. + self tally: #testIncludesKey. + self tally: #testIteratingKeys. + self tally: #testIteratingAssociations. + self tally: #testIteratingKeysAndValues. + self tally: #testSmalltalkDictionary. ] testSet [ @@ -244,15 +252,28 @@ Object subclass: Zen [ testIteration [ currentTest := TestIteration create: (self tracker). + self tally: #testWhileTrue. + self tally: #testWhileFalse. + self tally: #testTimesRepeat. ] testBoolean [ currentTest := TestBoolean create: (self tracker). - self tally: #testIfTrueAndIfFalse. + self tally: #testTrueIsTreatedAsTrue. + self tally: #testFalseIsTreatedAsFalse. + self tally: #testNilIsNotTreatedAsABoolean. + self tally: #testIfTrueAndIfFalseOnlyRespondsToBooleans. + self tally: #testAndShortCircuit. + self tally: #testOrShortCircuit. + self tally: #testEqv. + self tally: #testXor. ] testException [ currentTest := TestException create: (self tracker). + self tally: #testHaltAndError. + self tally: #testSignal. + self tally: #testCatchingExceptionsWithOnDo. ] testRegex [ @@ -291,6 +312,14 @@ Object subclass: Zen [ testClass [ currentTest := TestClass create: (self tracker). + self tally: #testName. + self tally: #testPragmas. + self tally: #testInstanceVariableCollection. + self tally: #testClassInstanceVariableCollection. + self tally: #testMessageCollection. + self tally: #testAllInstances. + self tally: #testSuperclass. + self tally: #testAllSubclasses. ] testClassHierarchy [