From 4b69ab08c18f7577b7cae79c934edf4dca5b2103 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Sat, 3 Apr 2021 21:56:42 +1100 Subject: WIP --- integration/main.go | 420 +++++++++++++++++++++ main/main.go | 18 - pkg/gui/gui.go | 4 +- pkg/gui/gui_test.go | 6 +- pkg/gui/recording.go | 6 + .../branchAutocomplete/expected/.git_keep/index | Bin 145 -> 145 bytes .../expected/.git_keep/logs/HEAD | 12 +- .../expected/.git_keep/logs/refs/heads/four | 2 +- .../expected/.git_keep/logs/refs/heads/master | 2 +- .../expected/.git_keep/logs/refs/heads/one | 2 +- .../expected/.git_keep/logs/refs/heads/three | 2 +- .../expected/.git_keep/logs/refs/heads/two | 2 +- .../33/7bfd3b397e5d29e526f25ed4fb6094f857eada | Bin 122 -> 0 bytes .../fa/aeb7b37a761da3170530e73b858a70b64cf584 | Bin 0 -> 122 bytes .../expected/.git_keep/refs/heads/four | 2 +- .../expected/.git_keep/refs/heads/master | 2 +- .../expected/.git_keep/refs/heads/one | 2 +- .../expected/.git_keep/refs/heads/three | 2 +- .../expected/.git_keep/refs/heads/two | 2 +- test/integration/branchAutocomplete/recording.json | 2 +- .../github.com/jesseduffield/gocui/tcell_driver.go | 1 + 21 files changed, 450 insertions(+), 39 deletions(-) create mode 100644 integration/main.go delete mode 100644 main/main.go delete mode 100644 test/integration/branchAutocomplete/expected/.git_keep/objects/33/7bfd3b397e5d29e526f25ed4fb6094f857eada create mode 100644 test/integration/branchAutocomplete/expected/.git_keep/objects/fa/aeb7b37a761da3170530e73b858a70b64cf584 diff --git a/integration/main.go b/integration/main.go new file mode 100644 index 000000000..770725e0a --- /dev/null +++ b/integration/main.go @@ -0,0 +1,420 @@ +package main + +import ( + "encoding/json" + "fmt" + "io" + "io/ioutil" + "os" + "path/filepath" + "strconv" + "strings" + + "github.com/creack/pty" + "github.com/jesseduffield/lazygit/pkg/commands/oscommands" + "github.com/jesseduffield/lazygit/pkg/secureexec" +) + +// To run an integration test, e.g. for test 'commit', go: +// go test pkg/gui/gui_test.go -run /commit +// +// To record keypresses for an integration test, pass RECORD_EVENTS=true like so: +// RECORD_EVENTS=true go test pkg/gui/gui_test.go -run /commit +// +// To update a snapshot for an integration test, pass UPDATE_SNAPSHOTS=true +// UPDATE_SNAPSHOTS=true go test pkg/gui/gui_test.go -run /commit +// +// When RECORD_EVENTS is true, updates will be updated automatically +// +// integration tests are run in test/integration_test and the final test does +// not clean up that directory so you can cd into it to see for yourself what +// happened when a test failed. +// +// To run tests in parallel pass `PARALLEL=true` as an env var. Tests are run in parallel +// on CI, and are run in a pty so you won't be able to see the stdout of the program +// +// To override speed, pass e.g. `SPEED=1` as an env var. Otherwise we start each test +// at a high speed and then drop down to lower speeds upon each failure until finally +// trying at the original playback speed (speed 1). A speed of 2 represents twice the +// original playback speed. Speed must be an integer. + +type integrationTest struct { + Name string `json:"name"` + Speed int `json:"speed"` + Description string `json:"description"` +} + +func loadTests(testDir string) ([]*integrationTest, error) { + paths, err := filepath.Glob(filepath.Join(testDir, "/*/test.json")) + if err != nil { + return nil, err + } + + tests := make([]*integrationTest, len(paths)) + + for i, path := range paths { + data, err := ioutil.ReadFile(path) + if err != nil { + return nil, err + } + + test := &integrationTest{} + + err = json.Unmarshal(data, test) + if err != nil { + return nil, err + } + + test.Name = strings.TrimPrefix(filepath.Dir(path), testDir+"/") + + tests[i] = test + } + + return tests, nil +} + +func generateSnapshot(dir string) (string, error) { + osCommand := oscommands.NewDummyOSCommand() + + _, err := os.Stat(filepath.Join(dir, ".git")) + if err != nil { + return "git directory not found", nil + } + + snapshot := "" + + statusCmd := fmt.Sprintf(`git -C %s status`, dir) + statusCmdOutput, err := osCommand.RunCommandWithOutput(statusCmd) + if err != nil { + return "", err + } + + snapshot += statusCmdOutput + "\n" + + logCmd := fmt.Sprintf(`git -C %s log --pretty=%%B -p -1`, dir) + logCmdOutput, err := osCommand.RunCommandWithOutput(logCmd) + if err != nil { + return "", err + } + + snapshot += logCmdOutput + "\n" + + err = filepath.Walk(dir, func(path string, f os.FileInfo, err error) error { + if err != nil { + return err + } + + if f.IsDir() { + if f.Name() == ".git" { + return filepath.SkipDir + } + return nil + } + + bytes, err := ioutil.ReadFile(path) + if err != nil { + return err + } + snapshot += string(bytes) + "\n" + + return nil + }) + + if err != nil { + return "", err + } + + return snapshot, nil +} + +func findOrCreateDir(path string) { + _, err := os.Stat(path) + if err != nil { + if os.IsNotExist(err) { + err = os.MkdirAll(path, 0777) + if err != nil { + panic(err) + } + } else { + panic(err) + } + } +} + +func getTestSpeeds(testStartSpeed int, updateSnapshots bool) []int { + if updateSnapshots { + // have to go at original speed if updating snapshots in case we go to fast and create a junk snapshot + return []int{1} + } + + speedEnv := os.Getenv("SPEED") + if speedEnv != "" { + speed, err := strconv.Atoi(speedEnv) + if err != nil { + panic(err) + } + return []int{speed} + } + + // default is 10, 5, 1 + startSpeed := 10 + if testStartSpeed != 0 { + startSpeed = testStartSpeed + } + speeds := []int{startSpeed} + if startSpeed > 5 { + speeds = append(speeds, 5) + } + speeds = append(speeds, 1) + + return speeds +} + +func tempLazygitPath() string { + return filepath.Join("/tmp", "lazygit", "test_lazygit") +} + +func Test() error { + rootDir := getRootDirectory() + err := os.Chdir(rootDir) + if err != nil { + return err + } + + testDir := filepath.Join(rootDir, "test", "integration") + + osCommand := oscommands.NewDummyOSCommand() + err = osCommand.RunCommand("go build -o %s", tempLazygitPath()) + if err != nil { + return err + } + + tests, err := loadTests(testDir) + if err != nil { + panic(err) + } + + record := os.Getenv("RECORD_EVENTS") != "" + updateSnapshots := record || os.Getenv("UPDATE_SNAPSHOTS") != "" + + for _, test := range tests[0:1] { + test := test + + speeds := getTestSpeeds(test.Speed, updateSnapshots) + + for i, speed := range speeds { + // t.Logf("%s: attempting test at speed %d\n", test.Name, speed) + + testPath := filepath.Join(testDir, test.Name) + actualDir := filepath.Join(testPath, "actual") + expectedDir := filepath.Join(testPath, "expected") + // t.Logf("testPath: %s, actualDir: %s, expectedDir: %s", testPath, actualDir, expectedDir) + findOrCreateDir(testPath) + + prepareIntegrationTestDir(actualDir) + + err := createFixture(testPath, actualDir) + if err != nil { + return err + } + + runLazygit(testPath, rootDir, record, speed) + + if updateSnapshots { + err = oscommands.CopyDir(actualDir, expectedDir) + if err != nil { + return err + } + } + + actual, err := generateSnapshot(actualDir) + if err != nil { + return err + } + + expected := "" + + func() { + // git refuses to track .git folders in subdirectories so we need to rename it + // to git_keep after running a test + + defer func() { + err = os.Rename( + filepath.Join(expectedDir, ".git"), + filepath.Join(expectedDir, ".git_keep"), + ) + + if err != nil { + panic(err) + } + }() + + // ignoring this error because we might not have a .git_keep file here yet. + _ = os.Rename( + filepath.Join(expectedDir, ".git_keep"), + filepath.Join(expectedDir, ".git"), + ) + + expected, err = generateSnapshot(expectedDir) + if err != nil { + panic(err) + } + }() + + if expected == actual { + // t.Logf("%s: success at speed %d\n", test.Name, speed) + break + } + + // if the snapshots and we haven't tried all playback speeds different we'll retry at a slower speed + if i == len(speeds)-1 { + // assert.Equal(t, expected, actual, fmt.Sprintf("expected:\n%s\nactual:\n%s\n", expected, actual)) + } + } + } + + return nil +} + +func createFixture(testPath, actualDir string) error { + osCommand := oscommands.NewDummyOSCommand() + bashScriptPath := filepath.Join(testPath, "setup.sh") + cmd := secureexec.Command("bash", bashScriptPath, actualDir) + + if err := osCommand.RunExecutable(cmd); err != nil { + return err + } + + return nil +} + +func getRootDirectory() string { + path, err := os.Getwd() + if err != nil { + panic(err) + } + + for { + _, err := os.Stat(filepath.Join(path, ".git")) + + if err == nil { + return path + } + + if !os.IsNotExist(err) { + panic(err) + } + + path = filepath.Dir(path) + + if path == "/" { + panic("must run in lazygit folder or child folder") + } + } +} + +func runLazygit(testPath string, rootDir string, record bool, speed int) error { + osCommand := oscommands.NewDummyOSCommand() + + replayPath := filepath.Join(testPath, "recording.json") + templateConfigDir := filepath.Join(rootDir, "test", "default_test_config") + actualDir := filepath.Join(testPath, "actual") + + exists, err := osCommand.FileExists(filepath.Join(testPath, "config")) + if err != nil { + return err + } + + if exists { + templateConfigDir = filepath.Join(testPath, "config") + } + + configDir := filepath.Join(testPath, "used_config") + + err = os.RemoveAll(configDir) + if err != nil { + return err + } + err = oscommands.CopyDir(templateConfigDir, configDir) + if err != nil { + return err + } + + cmdStr := fmt.Sprintf("%s -debug --use-config-dir=%s --path=%s", tempLazygitPath(), configDir, actualDir) + + cmd := osCommand.ExecutableFromString(cmdStr) + cmd.Env = append(cmd.Env, fmt.Sprintf("REPLAY_SPEED=%d", speed)) + + if record { + cmd.Stdout = os.Stdout + cmd.Stdin = os.Stdin + cmd.Stderr = os.Stderr + cmd.Env = append( + cmd.Env, + fmt.Sprintf("RECORD_EVENTS_TO=%s", replayPath), + ) + } else { + cmd.Stdout = os.Stdout + cmd.Stdin = os.Stdin + cmd.Stderr = os.Stderr + cmd.Env = append( + cmd.Env, + fmt.Sprintf("REPLAY_EVENTS_FROM=%s", replayPath), + ) + } + + // if we're on CI we'll need to use a PTY. We can work that out by seeing if the 'TERM' env is defined. + if runInPTY() { + cmd.Env = append(cmd.Env, "TERM=xterm") + + f, err := pty.StartWithSize(cmd, &pty.Winsize{Rows: 100, Cols: 100}) + if err != nil { + return err + } + + _, _ = io.Copy(ioutil.Discard, f) + + if err != nil { + return err + } + + _ = f.Close() + } else { + err := cmd.Run() + if err != nil { + return err + } + } + + return nil +} + +func runInParallel() bool { + return os.Getenv("PARALLEL") != "" +} + +func runInPTY() bool { + return runInParallel() || os.Getenv("TERM") == "" +} + +func prepareIntegrationTestDir(actualDir string) { + // remove contents of integration test directory + dir, err := ioutil.ReadDir(actualDir) + if err != nil { + if os.IsNotExist(err) { + err = os.Mkdir(actualDir, 0777) + if err != nil { + panic(err) + } + } else { + panic(err) + } + } + for _, d := range dir { + os.RemoveAll(filepath.Join(actualDir, d.Name())) + } +} + +func main() { + Test() +} diff --git a/main/main.go b/main/main.go deleted file mode 100644 index 9cf194899..000000000 --- a/main/main.go +++ /dev/null @@ -1,18 +0,0 @@ -package main - -import ( - "fmt" - "os" - "os/exec" -) - -func main() { - cmd := exec.Command("lazygit") - cmd.Env = os.Environ() - fmt.Println(cmd.Env) - cmd.Stderr = os.Stderr - cmd.Stdout = os.Stdout - cmd.Stdin = os.Stdin - err := cmd.Run() - fmt.Println(err) -} diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go index 987bdbc7e..93fed0525 100644 --- a/pkg/gui/gui.go +++ b/pkg/gui/gui.go @@ -482,7 +482,7 @@ func (gui *Gui) Run() error { go utils.Safe(gui.startBackgroundFetch) } - gui.goEvery(time.Millisecond*time.Duration(userConfig.Refresher.RefreshInterval), gui.stopChan, gui.refreshFilesAndSubmodules) + gui.goEvery(time.Second*time.Duration(userConfig.Refresher.RefreshInterval), gui.stopChan, gui.refreshFilesAndSubmodules) g.SetManager(gocui.ManagerFunc(gui.layout), gocui.ManagerFunc(gui.getFocusLayout())) @@ -649,7 +649,7 @@ func (gui *Gui) startBackgroundFetch() { prompt: gui.Tr.NoAutomaticGitFetchBody, }) } else { - gui.goEvery(time.Millisecond*time.Duration(userConfig.Refresher.FetchInterval), gui.stopChan, func() error { + gui.goEvery(time.Second*time.Duration(userConfig.Refresher.FetchInterval), gui.stopChan, func() error { err := gui.fetch(false) return err }) diff --git a/pkg/gui/gui_test.go b/pkg/gui/gui_test.go index 2fc73609f..3db424716 100644 --- a/pkg/gui/gui_test.go +++ b/pkg/gui/gui_test.go @@ -12,6 +12,7 @@ import ( "testing" "github.com/creack/pty" + "github.com/davecgh/go-spew/spew" "github.com/jesseduffield/lazygit/pkg/commands/oscommands" "github.com/jesseduffield/lazygit/pkg/secureexec" "github.com/stretchr/testify/assert" @@ -305,7 +306,7 @@ func runLazygit(t *testing.T, testPath string, rootDir string, record bool, spee err = oscommands.CopyDir(templateConfigDir, configDir) assert.NoError(t, err) - cmdStr := fmt.Sprintf("%s --use-config-dir=%s --path=%s", tempLazygitPath(), configDir, actualDir) + cmdStr := fmt.Sprintf("sudo dtruss %s --use-config-dir=%s --path=%s", tempLazygitPath(), configDir, actualDir) cmd := osCommand.ExecutableFromString(cmdStr) cmd.Env = append(cmd.Env, fmt.Sprintf("REPLAY_SPEED=%d", speed)) @@ -328,7 +329,7 @@ func runLazygit(t *testing.T, testPath string, rootDir string, record bool, spee fmt.Sprintf("REPLAY_EVENTS_FROM=%s", replayPath), "TERM=xterm-256color", ) - t.Log(cmd.Env) + t.Log(spew.Sdump(cmd)) } t.Log("here") @@ -337,6 +338,7 @@ func runLazygit(t *testing.T, testPath string, rootDir string, record bool, spee if runInPTY() { t.Log("1") cmd.Env = append(cmd.Env, "TERM=xterm") + t.Log(cmd.Env) f, err := pty.StartWithSize(cmd, &pty.Winsize{Rows: 100, Cols: 100}) assert.NoError(t, err) diff --git a/pkg/gui/recording.go b/pkg/gui/recording.go index 90b70c1ef..3bc5d1c7e 100644 --- a/pkg/gui/recording.go +++ b/pkg/gui/recording.go @@ -109,9 +109,12 @@ func (gui *Gui) loadRecordedEvents() ([]RecordedEvent, error) { err = json.Unmarshal(data, &events) if err != nil { + panic(err) return nil, err } + panic(events) + return events, nil } @@ -120,8 +123,11 @@ func (gui *Gui) saveRecordedEvents() error { return nil } + gui.Log.Warn(gui.RecordedEvents) + jsonEvents, err := json.Marshal(gui.RecordedEvents) if err != nil { + panic(err) return err } diff --git a/test/integration/branchAutocomplete/expected/.git_keep/index b/test/integration/branchAutocomplete/expected/.git_keep/index index 2cbd29d70..da60b166e 100644 Binary files a/test/integration/branchAutocomplete/expected/.git_keep/index and b/test/integration/branchAutocomplete/expected/.git_keep/index differ diff --git a/test/integration/branchAutocomplete/expected/.git_keep/logs/HEAD b/test/integration/branchAutocomplete/expected/.git_keep/logs/HEAD index 9d23a808d..b5b72b320 100644 --- a/test/integration/branchAutocomplete/expected/.git_keep/logs/HEAD +++ b/test/integration/branchAutocomplete/expected/.git_keep/logs/HEAD @@ -1,6 +1,6 @@ -0000000000000000000000000000000000000000 337bfd3b397e5d29e526f25ed4fb6094f857eada CI 1606556586 +1100 commit (initial): initial commit -337bfd3b397e5d29e526f25ed4fb6094f857eada 337bfd3b397e5d29e526f25ed4fb6094f857eada CI 1606556586 +1100 checkout: moving from master to one -337bfd3b397e5d29e526f25ed4fb6094f857eada 337bfd3b397e5d29e526f25ed4fb6094f857eada CI 1606556586 +1100 checkout: moving from one to two -337bfd3b397e5d29e526f25ed4fb6094f857eada 337bfd3b397e5d29e526f25ed4fb6094f857eada CI 1606556586 +1100 checkout: moving from two to three -337bfd3b397e5d29e526f25ed4fb6094f857eada 337bfd3b397e5d29e526f25ed4fb6094f857eada CI 1606556586 +1100 checkout: moving from three to four -337bfd3b397e5d29e526f25ed4fb6094f857eada 337bfd3b397e5d29e526f25ed4fb6094f857eada CI 1606556588 +1100 checkout: moving from four to three +0000000000000000000000000000000000000000 faaeb7b37a761da3170530e73b858a70b64cf584 CI 1617447323 +1100 commit (initial): initial commit +faaeb7b37a761da3170530e73b858a70b64cf584 faaeb7b37a761da3170530e73b858a70b64cf584 CI 1617447323 +1100 checkout: moving from master to one +faaeb7b37a761da3170530e73b858a70b64cf584 faaeb7b37a761da3170530e73b858a70b64cf584 CI 1617447323 +1100 checkout: moving from one to two +faaeb7b37a761da3170530e73b858a70b64cf584 faaeb7b37a761da3170530e73b858a70b64cf584 CI 1617447323 +1100 checkout: moving from two to three +faaeb7b37a761da3170530e73b858a70b64cf584 faaeb7b37a761da3170530e73b858a70b64cf584 CI 1617447323 +1100 checkout: moving from three to four +faaeb7b37a761da3170530e73b858a70b64cf584 faaeb7b37a761da3170530e73b858a70b64cf584 CI 1617447327 +1100 checkout: moving from four to three diff --git a/test/integration/branchAutocomplete/expected/.git_keep/logs/refs/heads/four b/test/integration/branchAutocomplete/expected/.git_keep/logs/refs/heads/four index 60cff0a2a..d3c8a3403 100644 --- a/test/integration/branchAutocomplete/expected/.git_keep/logs/refs/heads/four +++ b/test/integration/branchAutocomplete/expected/.git_keep/logs/refs/heads/four @@ -1 +1 @@ -0000000000000000000000000000000000000000 337bfd3b397e5d29e526f25ed4fb6094f857eada CI 1606556586 +1100 branch: Created from HEAD +0000000000000000000000000000000000000000 faaeb7b37a761da3170530e73b858a70b64cf584 CI 1617447323 +1100 branch: Created from HEAD diff --git a/test/integration/branchAutocomplete/expected/.git_keep/logs/refs/heads/master b/test/integration/branchAutocomplete/expected/.git_keep/logs/refs/heads/master index b8ad47a8e..572e103ff 100644 --- a/test/integration/branchAutocomplete/expected/.git_keep/logs/refs/heads/master +++ b/test/integration/branchAutocomplete/expected/.git_keep/logs/refs/heads/master @@ -1 +1 @@ -0000000000000000000000000000000000000000 337bfd3b397e5d29e526f25ed4fb6094f857eada CI 1606556586 +1100 commit (initial): initial commit +0000000000000000000000000000000000000000 faaeb7b37a761da3170530e73b858a70b64cf584 CI 1617447323 +1100 commit (initial): initial commit diff --git a/test/integration/branchAutocomplete/expected/.git_keep/logs/refs/heads/one b/test/integration/branchAutocomplete/expected/.git_keep/logs/refs/heads/one index 60cff0a2a..d3c8a3403 100644 --- a/test/integration/branchAutocomplete/expected/.git_keep/logs/refs/heads/one +++ b/test/integration/branchAutocomplete/expected/.git_keep/logs/refs/heads/one @@ -1 +1 @@ -0000000000000000000000000000000000000000 337bfd3b397e5d29e526f25ed4fb6094f857eada CI 1606556586 +1100 branch: Created from HEAD +0000000000000000000000000000000000000000 faaeb7b37a761da3170530e73b858a70b64cf584 CI 1617447323 +1100 branch: Created from HEAD diff --git a/test/integration/branchAutocomplete/expected/.git_keep/logs/refs/heads/three b/test/integration/branchAutocomplete/expected/.git_keep/logs/refs/heads/three index 60cff0a2a..d3c8a3403 100644 --- a/test/integration/branchAutocomplete/expected/.git_keep/logs/refs/heads/three +++ b/test/integration/branchAutocomplete/expected/.git_keep/logs/refs/heads/three @@ -1 +1 @@ -0000000000000000000000000000000000000000 337bfd3b397e5d29e526f25ed4fb6094f857eada CI 1606556586 +1100 branch: Created from HEAD +0000000000000000000000000000000000000000 faaeb7b37a761da3170530e73b858a70b64cf584 CI 1617447323 +1100 branch: Created from HEAD diff --git a/test/integration/branchAutocomplete/expected/.git_keep/logs/refs/heads/two b/test/integration/branchAutocomplete/expected/.git_keep/logs/refs/heads/two index 60cff0a2a..d3c8a3403 100644 --- a/test/integration/branchAutocomplete/expected/.git_keep/logs/refs/heads/two +++ b/test/integration/branchAutocomplete/expected/.git_keep/logs/refs/heads/two @@ -1 +1 @@ -0000000000000000000000000000000000000000 337bfd3b397e5d29e526f25ed4fb6094f857eada CI 1606556586 +1100 branch: Created from HEAD +0000000000000000000000000000000000000000 faaeb7b37a761da3170530e73b858a70b64cf584 CI 1617447323 +1100 branch: Created from HEAD diff --git a/test/integration/branchAutocomplete/expected/.git_keep/objects/33/7bfd3b397e5d29e526f25ed4fb6094f857eada b/test/integration/branchAutocomplete/expected/.git_keep/objects/33/7bfd3b397e5d29e526f25ed4fb6094f857eada deleted file mode 100644 index 261884517..000000000 Binary files a/test/integration/branchAutocomplete/expected/.git_keep/objects/33/7bfd3b397e5d29e526f25ed4fb6094f857eada and /dev/null differ diff --git a/test/integration/branchAutocomplete/expected/.git_keep/objects/fa/aeb7b37a761da3170530e73b858a70b64cf584 b/test/integration/branchAutocomplete/expected/.git_keep/objects/fa/aeb7b37a761da3170530e73b858a70b64cf584 new file mode 100644 index 000000000..6d0fda0f8 Binary files /dev/null and b/test/integration/branchAutocomplete/expected/.git_keep/objects/fa/aeb7b37a761da3170530e73b858a70b64cf584 differ diff --git a/test/integration/branchAutocomplete/expected/.git_keep/refs/heads/four b/test/integration/branchAutocomplete/expected/.git_keep/refs/heads/four index 9bb9be141..d5481de4f 100644 --- a/test/integration/branchAutocomplete/expected/.git_keep/refs/heads/four +++ b/test/integration/branchAutocomplete/expected/.git_keep/refs/heads/four @@ -1 +1 @@ -337bfd3b397e5d29e526f25ed4fb6094f857eada +faaeb7b37a761da3170530e73b858a70b64cf584 diff --git a/test/integration/branchAutocomplete/expected/.git_keep/refs/heads/master b/test/integration/branchAutocomplete/expected/.git_keep/refs/heads/master index 9bb9be141..d5481de4f 100644 --- a/test/integration/branchAutocomplete/expected/.git_keep/refs/heads/master +++ b/test/integration/branchAutocomplete/expected/.git_keep/refs/heads/master @@ -1 +1 @@ -337bfd3b397e5d29e526f25ed4fb6094f857eada +faaeb7b37a761da3170530e73b858a70b64cf584 diff --git a/test/integration/branchAutocomplete/expected/.git_keep/refs/heads/one b/test/integration/branchAutocomplete/expected/.git_keep/refs/heads/one index 9bb9be141..d5481de4f 100644 --- a/test/integration/branchAutocomplete/expected/.git_keep/refs/heads/one +++ b/test/integration/branchAutocomplete/expected/.git_keep/refs/heads/one @@ -1 +1 @@ -337bfd3b397e5d29e526f25ed4fb6094f857eada +faaeb7b37a761da3170530e73b858a70b64cf584 diff --git a/test/integration/branchAutocomplete/expected/.git_keep/refs/heads/three b/test/integration/branchAutocomplete/expected/.git_keep/refs/heads/three index 9bb9be141..d5481de4f 100644 --- a/test/integration/branchAutocomplete/expected/.git_keep/refs/heads/three +++ b/test/integration/branchAutocomplete/expected/.git_keep/refs/heads/three @@ -1 +1 @@ -337bfd3b397e5d29e526f25ed4fb6094f857eada +faaeb7b37a761da3170530e73b858a70b64cf584 diff --git a/test/integration/branchAutocomplete/expected/.git_keep/refs/heads/two b/test/integration/branchAutocomplete/expected/.git_keep/refs/heads/two index 9bb9be141..d5481de4f 100644 --- a/test/integration/branchAutocomplete/expected/.git_keep/refs/heads/two +++ b/test/integration/branchAutocomplete/expected/.git_keep/refs/heads/two @@ -1 +1 @@ -337bfd3b397e5d29e526f25ed4fb6094f857eada +faaeb7b37a761da3170530e73b858a70b64cf584 diff --git a/test/integration/branchAutocomplete/recording.json b/test/integration/branchAutocomplete/recording.json index c3a32d780..0637a088a 100644 --- a/test/integration/branchAutocomplete/recording.json +++ b/test/integration/branchAutocomplete/recording.json @@ -1 +1 @@ -[{"Timestamp":22,"Event":{"Type":1,"Mod":0,"Key":0,"Ch":0,"Width":0,"Height":0,"Err":null,"MouseX":0,"MouseY":0,"N":0,"Bytes":null}},{"Timestamp":488,"Event":{"Type":0,"Mod":0,"Key":65514,"Ch":0,"Width":0,"Height":0,"Err":null,"MouseX":0,"MouseY":0,"N":3,"Bytes":"G09D"}},{"Timestamp":721,"Event":{"Type":0,"Mod":0,"Key":0,"Ch":99,"Width":0,"Height":0,"Err":null,"MouseX":0,"MouseY":0,"N":1,"Bytes":"Yw=="}},{"Timestamp":937,"Event":{"Type":0,"Mod":0,"Key":0,"Ch":116,"Width":0,"Height":0,"Err":null,"MouseX":0,"MouseY":0,"N":1,"Bytes":"dA=="}},{"Timestamp":1073,"Event":{"Type":0,"Mod":0,"Key":0,"Ch":104,"Width":0,"Height":0,"Err":null,"MouseX":0,"MouseY":0,"N":1,"Bytes":"aA=="}},{"Timestamp":1128,"Event":{"Type":0,"Mod":0,"Key":0,"Ch":114,"Width":0,"Height":0,"Err":null,"MouseX":0,"MouseY":0,"N":1,"Bytes":"cg=="}},{"Timestamp":1201,"Event":{"Type":0,"Mod":0,"Key":0,"Ch":101,"Width":0,"Height":0,"Err":null,"MouseX":0,"MouseY":0,"N":1,"Bytes":"ZQ=="}},{"Timestamp":1457,"Event":{"Type":0,"Mod":0,"Key":9,"Ch":0,"Width":0,"Height":0,"Err":null,"MouseX":0,"MouseY":0,"N":1,"Bytes":"CQ=="}},{"Timestamp":1736,"Event":{"Type":0,"Mod":0,"Key":13,"Ch":0,"Width":0,"Height":0,"Err":null,"MouseX":0,"MouseY":0,"N":1,"Bytes":"DQ=="}},{"Timestamp":2264,"Event":{"Type":0,"Mod":0,"Key":0,"Ch":113,"Width":0,"Height":0,"Err":null,"MouseX":0,"MouseY":0,"N":1,"Bytes":"cQ=="}}] \ No newline at end of file +[] \ No newline at end of file diff --git a/vendor/github.com/jesseduffield/gocui/tcell_driver.go b/vendor/github.com/jesseduffield/gocui/tcell_driver.go index 517f102dd..66e4c1cfa 100644 --- a/vendor/github.com/jesseduffield/gocui/tcell_driver.go +++ b/vendor/github.com/jesseduffield/gocui/tcell_driver.go @@ -117,6 +117,7 @@ type GocuiEvent struct { MouseX int MouseY int N int + Bytes string } // Event types. -- cgit v1.2.3