Skip to content

Commit

Permalink
Merge pull request #710 from bouraqadi/revert-method-version-context-…
Browse files Browse the repository at this point in the history
…menu-bug-fix-pharo-issue-16045

Bug fix for Pharo issue 16045
  • Loading branch information
Ducasse authored Feb 24, 2024
2 parents ceae3ea + 04affb6 commit 7e90acb
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/BaselineOfNewTools/BaselineOfNewTools.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ BaselineOfNewTools >> baseline: spec [
package: 'NewTools-Gtk';
"Basic tools (inherited from Spec)"
package: 'NewTools-MethodBrowsers' with: [ spec requires: #( 'NewTools-SpTextPresenterDecorators' ) ];
package: 'NewTools-MethodBrowsers-Tests' with: [ spec requires: #( 'NewTools-MethodBrowsers' ) ];
package: 'NewTools-KeymapBrowser';
"inspector"
package: 'NewTools-Inspector' with: [ spec requires: #( 'NewTools-Inspector-Extensions' ) ];
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Extension { #name : 'StVersionBrowserPresenter' }

{ #category : '*NewTools-MethodBrowsers-Tests' }
StVersionBrowserPresenter >> selectIndex: index [

messageList selectIndex: index
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
Class {
#name : 'StVersionBrowserPresenterTest',
#superclass : 'TestCase',
#instVars : [
'class',
'factory'
],
#category : 'NewTools-MethodBrowsers-Tests',
#package : 'NewTools-MethodBrowsers-Tests'
}

{ #category : 'running' }
StVersionBrowserPresenterTest >> setUp [
super setUp.
factory := ClassFactoryForTestCase new.
class := factory newClass

]

{ #category : 'running' }
StVersionBrowserPresenterTest >> tearDown [
factory cleanUp.
super tearDown
]

{ #category : 'running' }
StVersionBrowserPresenterTest >> testRevertOldMethod [
| browser |
class compile: 'm
^1'.
self assert: class new m equals: 1.
class compile: 'm
^2'.
self assert: class new m equals: 2.
browser := StVersionBrowserPresenter on: class >> #m.
browser selectIndex: browser changeList size.
browser doRevert.
self assert: class new m equals: 1.


]
1 change: 1 addition & 0 deletions src/NewTools-MethodBrowsers-Tests/package.st
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Package { #name : 'NewTools-MethodBrowsers-Tests' }
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ StVersionBrowserPresenter >> doCompareToOtherVersion [

{ #category : 'actions' }
StVersionBrowserPresenter >> doRevert [

self revert: self selectedMessage
]

{ #category : 'initialization' }
Expand Down Expand Up @@ -296,7 +296,7 @@ StVersionBrowserPresenter >> newMessageList [
StVersionBrowserPresenter >> newMessageToolbar [

^ (self instantiate: StMethodHistoryToolbarPresenter on: rgMethod)
whenRevertDo: [ self revert: self selectedMessage ];
whenRevertDo: [ self doRevert ];
yourself
]

Expand Down

0 comments on commit 7e90acb

Please sign in to comment.