Levente Uzonyi uploaded a new version of Tests to project The Trunk:
http://source.squeak.org/trunk/Tests-ul.163.mcz ==================== Summary ==================== Name: Tests-ul.163 Author: ul Time: 14 September 2012, 1:58:29.425 pm UUID: c716a059-f5d3-724c-b5c4-54ba9613e026 Ancestors: Tests-ul.162 Added ClassRemovalTest which reveals a bug in the current system. =============== Diff against Tests-ul.162 =============== Item was added: + TestCase subclass: #ClassRemovalTest + instanceVariableNames: 'isClean' + classVariableNames: '' + poolDictionaries: '' + category: 'Tests-Bugs'! Item was added: + ----- Method: ClassRemovalTest>>className1 (in category 'utility') ----- + className1 + + ^#ClassToBeRemoved! Item was added: + ----- Method: ClassRemovalTest>>className2 (in category 'utility') ----- + className2 + + ^#ReferringClass! Item was added: + ----- Method: ClassRemovalTest>>setUp (in category 'running') ----- + setUp + + isClean := (SystemOrganizer default listAtCategoryNamed: self systemCategoryName) isEmpty + and: [ (Smalltalk hasClassNamed: self className1) not + and: [ (Smalltalk hasClassNamed: self className2) not ] ]! Item was added: + ----- Method: ClassRemovalTest>>systemCategoryName (in category 'utility') ----- + systemCategoryName + + ^'ReferencedClassRemoveTest'! Item was added: + ----- Method: ClassRemovalTest>>tearDown (in category 'running') ----- + tearDown + + isClean ifTrue: [ + (Smalltalk at: self className1) removeFromSystem. + (Smalltalk at: self className2) removeFromSystem. + SystemOrganizer default removeCategory: self systemCategoryName ]! Item was added: + ----- Method: ClassRemovalTest>>testClassRemovalAndRecompilcationWontCreateDuplicateVariableBindings (in category 'tests') ----- + testClassRemovalAndRecompilcationWontCreateDuplicateVariableBindings + + self + assert: isClean + description: 'The system category or the classes about to be created already exist.'. + "Create a class" + Object subclass: self className1 + instanceVariableNames: '' + classVariableNames: '' + poolDictionaries: '' + category: self systemCategoryName. + "Create another" + Object subclass: self className2 + instanceVariableNames: '' + classVariableNames: '' + poolDictionaries: '' + category: self systemCategoryName. + "Compile a method in the second which references the first" + (Smalltalk at: self className2) + compile: 'foo ^', self className1 + classified: 'accessing'. + "Remove the first class" + (Smalltalk at: self className1) removeFromSystem. + "Compile the first class again" + Object subclass: self className1 + instanceVariableNames: '' + classVariableNames: '' + poolDictionaries: '' + category: self systemCategoryName. + self + deny: (Smalltalk at: self className2) new foo isObsolete + description: '#foo refers to an obsolete class'. + self + assert: (Smalltalk at: self className1) == + (Smalltalk at: self className2) new foo + description: '#foo refers to a different class'! |
Free forum by Nabble | Edit this page |