diff --git a/src/NewTools-Debugger-Tests/StDebuggerContextPredicateTest.class.st b/src/NewTools-Debugger-Tests/StDebuggerContextPredicateTest.class.st index e36a8ec4c..69ac5f1de 100644 --- a/src/NewTools-Debugger-Tests/StDebuggerContextPredicateTest.class.st +++ b/src/NewTools-Debugger-Tests/StDebuggerContextPredicateTest.class.st @@ -42,12 +42,28 @@ StDebuggerContextPredicateTest >> testIsSteppable [ self deny: predicate isSteppable ] +{ #category : #tests } +StDebuggerContextPredicateTest >> testPrintDNUDescription [ + self assert: (StDebuggerActionModel on: + ([ Object perform: #thisMessageIsNotUnderstood ] on: Exception do: + [ :e | StTestDebuggerProvider new sessionFor: nil exception: e ]) session) statusStringForContext + equals: 'Instance of Object class did not understand #thisMessageIsNotUnderstood'. +] + { #category : #tests } StDebuggerContextPredicateTest >> testPrintDescription [ self skip. self assert: predicate printDescription equals: '0' ] +{ #category : #tests } +StDebuggerContextPredicateTest >> testPrintExceptionDescription [ + self assert: (StDebuggerActionModel on: + ([ Exception signal ] on: Exception do: + [ :e | StTestDebuggerProvider new sessionFor: nil exception: e ]) session) statusStringForContext + equals: 'Exception'. +] + { #category : #tests } StDebuggerContextPredicateTest >> testPrintHaltDescription [ |haltContext| @@ -56,9 +72,41 @@ StDebuggerContextPredicateTest >> testPrintHaltDescription [ self assert: predicate printDescription equals: 'Halt in ', haltContext printString ] +{ #category : #tests } +StDebuggerContextPredicateTest >> testPrintHaltIfDescription [ + self assert: (StDebuggerActionModel on: + ([ Halt if: [ true ] ] on: Exception do: + [ :e | StTestDebuggerProvider new sessionFor: nil exception: e ]) session) statusStringForContext + equals: 'Halt in [ Halt if: [ true ] ] in StDebuggerContextPredicateTest>>testPrintHaltIfDescription'. +] + +{ #category : #tests } +StDebuggerContextPredicateTest >> testPrintHaltNowDescription [ + self assert: (StDebuggerActionModel on: + ([ Halt now ] on: Exception do: + [ :e | StTestDebuggerProvider new sessionFor: nil exception: e ]) session) statusStringForContext + equals: 'Halt'. +] + { #category : #tests } StDebuggerContextPredicateTest >> testPrintPostMortemDescription [ self skip. predicate postMortem: true. self assert: predicate printDescription equals: '[Post-mortem] 0' ] + +{ #category : #tests } +StDebuggerContextPredicateTest >> testPrintSignalInDescription [ + self assert: (StDebuggerActionModel on: + ([ Exception signalIn: thisContext ] on: Exception do: + [ :e | StTestDebuggerProvider new sessionFor: nil exception: e ]) session) statusStringForContext + equals: 'Exception'. +] + +{ #category : #tests } +StDebuggerContextPredicateTest >> testPrintTestFailureDescription [ + self assert: (StDebuggerActionModel on: + ([ TestFailure signal ] on: Exception do: + [ :e | StTestDebuggerProvider new sessionFor: nil exception: e ]) session) statusStringForContext + equals: 'TestFailure'. +] diff --git a/src/NewTools-Debugger/Halt.extension.st b/src/NewTools-Debugger/Halt.extension.st new file mode 100644 index 000000000..bdfbc82c3 --- /dev/null +++ b/src/NewTools-Debugger/Halt.extension.st @@ -0,0 +1,8 @@ +Extension { #name : #Halt } + +{ #category : #'*NewTools-Debugger' } +Halt >> description [ + (self signalContext receiver isKindOf: Exception) + & (self signalContext selector = #signal) ifTrue: [ ^ 'Halt' ]. + ^ 'Halt in ', self signalContext asString. +] diff --git a/src/NewTools-Debugger/StDebuggerActionModel.class.st b/src/NewTools-Debugger/StDebuggerActionModel.class.st index e5d517591..9145cdf7f 100644 --- a/src/NewTools-Debugger/StDebuggerActionModel.class.st +++ b/src/NewTools-Debugger/StDebuggerActionModel.class.st @@ -351,7 +351,7 @@ StDebuggerActionModel >> stackOfSize: anInteger [ { #category : #context } StDebuggerActionModel >> statusStringForContext [ - ^ self contextPredicate printDescription + ^ self exception description ] { #category : #'debug - stepping' }