diff options
author | Ryooooooga <eial5q265e5@gmail.com> | 2021-08-23 22:35:19 +0900 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2021-08-25 21:32:48 +1000 |
commit | c3d7de1c183ddf2bea39647114403d16825fdd9d (patch) | |
tree | 57a4ead9c3cdc0ce3a54cc697bf847953b29ff11 /pkg/commands/files_test.go | |
parent | 711bd5a670f5321495700a55503e4d4a9742f7ae (diff) |
Change not to use cat command
Diffstat (limited to 'pkg/commands/files_test.go')
-rw-r--r-- | pkg/commands/files_test.go | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/pkg/commands/files_test.go b/pkg/commands/files_test.go index 0410c95c2..19a014eaa 100644 --- a/pkg/commands/files_test.go +++ b/pkg/commands/files_test.go @@ -4,7 +4,6 @@ import ( "fmt" "io/ioutil" "os/exec" - "runtime" "testing" "github.com/jesseduffield/lazygit/pkg/commands/models" @@ -13,28 +12,6 @@ import ( "github.com/stretchr/testify/assert" ) -// TestGitCommandCatFile tests emitting a file using commands, where commands vary by OS. -func TestGitCommandCatFile(t *testing.T) { - var osCmd string - switch os := runtime.GOOS; os { - case "windows": - osCmd = "type" - default: - osCmd = "cat" - } - gitCmd := NewDummyGitCommand() - gitCmd.OSCommand.Command = func(cmd string, args ...string) *exec.Cmd { - assert.EqualValues(t, osCmd, cmd) - assert.EqualValues(t, []string{"test.txt"}, args) - - return secureexec.Command("echo", "-n", "test") - } - - o, err := gitCmd.CatFile("test.txt") - assert.NoError(t, err) - assert.Equal(t, "test", o) -} - // TestGitCommandStageFile is a function. func TestGitCommandStageFile(t *testing.T) { gitCmd := NewDummyGitCommand() |