Skip to content

Commit

Permalink
- Made Halt print without context when signalled directly, to match e…
Browse files Browse the repository at this point in the history
…xisting behavior
  • Loading branch information
emdonahue committed Sep 7, 2022
1 parent 19f014f commit a4e8527
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,14 @@ StDebuggerContextPredicateTest >> testPrintHaltIfDescription [
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.
Expand Down
8 changes: 8 additions & 0 deletions src/NewTools-Debugger/Halt.extension.st
Original file line number Diff line number Diff line change
@@ -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.
]
2 changes: 1 addition & 1 deletion src/NewTools-Debugger/StDebuggerActionModel.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ StDebuggerActionModel >> stackOfSize: anInteger [
{ #category : #context }
StDebuggerActionModel >> statusStringForContext [

^ self contextPredicate printDescription
^ self exception description
]

{ #category : #'debug - stepping' }
Expand Down

0 comments on commit a4e8527

Please sign in to comment.