mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-11 12:25:47 +02:00
move code from main into app package to allow test to be injected
This commit is contained in:
parent
d890238c7b
commit
ba96baee32
68 changed files with 1096 additions and 482 deletions
|
@ -9,20 +9,20 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/jesseduffield/gocui"
|
||||
"github.com/jesseduffield/lazygit/pkg/gui/types"
|
||||
integrationTypes "github.com/jesseduffield/lazygit/pkg/integration/types"
|
||||
"github.com/jesseduffield/lazygit/pkg/utils"
|
||||
)
|
||||
|
||||
type IntegrationTest interface {
|
||||
Run(guiAdapter *GuiAdapterImpl)
|
||||
Run(guiAdapter *GuiAdapter)
|
||||
}
|
||||
|
||||
func (gui *Gui) handleTestMode(test types.Test) {
|
||||
func (gui *Gui) handleTestMode(test integrationTypes.IntegrationTest) {
|
||||
if test != nil {
|
||||
go func() {
|
||||
time.Sleep(time.Millisecond * 100)
|
||||
|
||||
test.Run(&GuiAdapterImpl{gui: gui})
|
||||
test.Run(&GuiAdapter{gui: gui})
|
||||
|
||||
gui.g.Update(func(*gocui.Gui) error {
|
||||
return gocui.ErrQuit
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue