testMetaclassSuperclass "self run: #testMetaclassSuperclass"
self assert: Dictionary class superclass == Set class. self assert: OrderedCollection class superclass == SequenceableCollection class.
What is the important is the metaclass relationship, and not really the fact that Dictionary is a subclass of Set. I think this is better: self assert: Dictionary class superclass == Dictionary superclass class. self assert: OrderedCollection class superclass == OrderedCollection superclass class.
testSuperclass "self run: #testSuperclass"
| s | self assert: Dictionary superclass == Set. self assert: OrderedCollection superclass == SequenceableCollection.
s := OrderedCollection new. s add: SequenceableCollection. s add: Collection. s add: Object. s add: ProtoObject.
self assert: OrderedCollection allSuperclasses = s.
I would rewrite the test as: testSuperclass "self debug: #testSuperclass" | s b | s := OrderedCollection new. b := [:cls | cls ifNotNil: [s add: cls. b value: cls superclass] ]. b value: OrderedCollection. self assert: OrderedCollection allSuperclasses = s allButFirst. self assert: OrderedCollection withAllSuperclasses = s. You even test #withAllSuperclasses in that case. Cheers, Alexandre
let me know what you think.
Stef
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project