introduce gui adapter

This commit is contained in:
Jesse Duffield 2022-08-09 20:27:44 +10:00
parent 225c563c63
commit 46ae55f91e
20 changed files with 763 additions and 297 deletions

View file

@ -10,6 +10,10 @@ import (
"github.com/jesseduffield/lazygit/pkg/utils"
)
type IntegrationTest interface {
Run(guiAdapter *GuiAdapterImpl)
}
func (gui *Gui) handleTestMode() {
if integration.PlayingIntegrationTest() {
test, ok := integration.CurrentIntegrationTest()
@ -21,17 +25,7 @@ func (gui *Gui) handleTestMode() {
go func() {
time.Sleep(time.Millisecond * 100)
shell := &integration.ShellImpl{}
assert := &AssertImpl{gui: gui}
keys := gui.Config.GetUserConfig().Keybinding
input := NewInputImpl(gui, keys, assert, integration.KeyPressDelay())
test.Run(
shell,
input,
assert,
gui.c.UserConfig.Keybinding,
)
test.Run(&GuiAdapterImpl{gui: gui})
gui.g.Update(func(*gocui.Gui) error {
return gocui.ErrQuit