A new version of SUnitTools was added to project The Inbox:
http://source.squeak.org/inbox/SUnitTools-ct.6.mcz ==================== Summary ==================== Name: SUnitTools-ct.6 Author: ct Time: 14 November 2020, 8:14:53.273394 pm UUID: 2fe96258-4e5a-cc48-86e0-d0ca57eedbf7 Ancestors: SUnitTools-tcj.4 Proposal: Show modal notification if "find test case" or "find tested item" in a class or message menu failed to find an appropriate code object. =============== Diff against SUnitTools-tcj.4 =============== Item was changed: ----- Method: CodeHolder>>testBrowseClassNamed:possibleMessageNamed: (in category '*SUnitTools-running') ----- testBrowseClassNamed: aClassName possibleMessageNamed: aMessageName | cls selector | + (self class environment hasClassNamed: aClassName) + ifFalse: [^ false]. - (self class environment hasClassNamed: aClassName) ifFalse: ["no dice" ^ self]. cls := self class environment classNamed: aClassName. (aMessageName notNil and: [cls includesLocalSelector: (selector := aMessageName asSymbol)]) ifTrue: [ToolSet browse: cls selector: selector] + ifFalse: [ToolSet browseClass: cls]. + + ^ true! - ifFalse: [ToolSet browseClass: cls].! Item was changed: ----- Method: CodeHolder>>testFindTest (in category '*SUnitTools-running') ----- testFindTest | cls destClassName destMessage | cls := self selectedClass ifNil: [^ self]. - cls isTestClass ifTrue: [" already there " ^ self]. destClassName := cls name asString, 'Test'. destMessage := self selectedMessageName ifNotNil: [:name | self testSelectorFrom: name]. + + (self testBrowseClassNamed: destClassName possibleMessageNamed: destMessage) + ifFalse: [self inform: ('There is no test for {1}' translated + format: {self selectedMessageName ifNil: [cls]})].! - self testBrowseClassNamed: destClassName possibleMessageNamed: destMessage - ! Item was changed: ----- Method: CodeHolder>>testFindTested (in category '*SUnitTools-running') ----- testFindTested | cls classNameParts destClassName destMessage | cls := self selectedClass ifNil: [^ self]. cls isTestClass ifFalse: [" already there " ^ self]. classNameParts := cls name asString piecesCutWhere: [:a :b | b isUppercase]. destClassName := (classNameParts last beginsWith: 'Test') ifTrue: [classNameParts allButLast join] + ifFalse: [^ self inform: ('Did not find tested item for {1}' translated + format: {cls})]. - ifFalse: [^ self]. destMessage := self selectedMessageName ifNotNil: [:selector | | messageName | messageName := selector asString. (messageName beginsWith: 'test') "operate on test methods only" ifTrue: [ (self class environment classNamed: destClassName) ifNotNil: [:destClass | destClass selectors detect: [:destSelector | (self testSelectorFrom: destSelector) = messageName] ifNone: [nil]]] ifFalse: [nil]]. + + (self testBrowseClassNamed: destClassName possibleMessageNamed: destMessage) + ifFalse: [self inform: ('Did not find tested item for {1}' translated + format: {self selectedMessageName ifNil: [cls]})].! - self testBrowseClassNamed: destClassName possibleMessageNamed: destMessage - ! |
Free forum by Nabble | Edit this page |