summaryrefslogtreecommitdiffstats
path: root/pkg/gui
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2021-04-05 13:07:25 +1000
committerJesse Duffield <jessedduffield@gmail.com>2021-04-06 19:34:32 +1000
commitee7b634dced182e76ab83f9d025001f506e6b59e (patch)
treeb8a668d79a57f12a36d0672b83302ad5be2651ad /pkg/gui
parentb0bd7521805dd609006fc778e6de76b2f5c6eb81 (diff)
how about using pty
Diffstat (limited to 'pkg/gui')
-rw-r--r--pkg/gui/gui_test.go10
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) {