diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2021-04-05 13:07:25 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2021-04-06 19:34:32 +1000 |
commit | ee7b634dced182e76ab83f9d025001f506e6b59e (patch) | |
tree | b8a668d79a57f12a36d0672b83302ad5be2651ad /pkg/gui/gui_test.go | |
parent | b0bd7521805dd609006fc778e6de76b2f5c6eb81 (diff) |
how about using pty
Diffstat (limited to 'pkg/gui/gui_test.go')
-rw-r--r-- | pkg/gui/gui_test.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/pkg/gui/gui_test.go b/pkg/gui/gui_test.go index d6e2e12bc..938765caf 100644 --- a/pkg/gui/gui_test.go +++ b/pkg/gui/gui_test.go @@ -3,6 +3,7 @@ package gui import ( "encoding/json" "fmt" + "io" "io/ioutil" "os" "path/filepath" @@ -10,6 +11,7 @@ import ( "strings" "testing" + "github.com/creack/pty" "github.com/jesseduffield/lazygit/pkg/commands/oscommands" "github.com/jesseduffield/lazygit/pkg/secureexec" "github.com/stretchr/testify/assert" @@ -315,8 +317,14 @@ func runLazygit(t *testing.T, testPath string, rootDir string, configDir string, "TERM=xterm", ) - err = cmd.Run() + f, err := pty.StartWithSize(cmd, &pty.Winsize{Rows: 100, Cols: 100}) assert.NoError(t, err) + + _, _ = io.Copy(ioutil.Discard, f) + + assert.NoError(t, err) + + _ = f.Close() } func prepareIntegrationTestDir(actualDir string) { |