summaryrefslogtreecommitdiffstats
path: root/pkg/commands/oscommands/os_test.go
diff options
context:
space:
mode:
authorRyooooooga <eial5q265e5@gmail.com>2021-10-09 16:44:27 +0900
committerJesse Duffield <jessedduffield@gmail.com>2021-10-16 22:40:50 +1100
commit2dc8396debb38c11b66fe40ca2ebd69aed68faa0 (patch)
treecbd9a2697260a73dace70eb1e6c377593d0cc58d /pkg/commands/oscommands/os_test.go
parent7b615e31860c1ea56ddc5813b81a8f20d012af34 (diff)
Fix test
Diffstat (limited to 'pkg/commands/oscommands/os_test.go')
-rw-r--r--pkg/commands/oscommands/os_test.go18
1 files changed, 9 insertions, 9 deletions
diff --git a/pkg/commands/oscommands/os_test.go b/pkg/commands/oscommands/os_test.go
index 2f015c21c..3769df071 100644
--- a/pkg/commands/oscommands/os_test.go
+++ b/pkg/commands/oscommands/os_test.go
@@ -80,8 +80,8 @@ func TestOSCommandOpenFile(t *testing.T) {
{
"test",
func(name string, arg ...string) *exec.Cmd {
- assert.Equal(t, "open", name)
- assert.Equal(t, []string{"test"}, arg)
+ assert.Equal(t, "bash", name)
+ assert.Equal(t, []string{"-c", `open "test"`}, arg)
return secureexec.Command("echo")
},
func(err error) {
@@ -91,8 +91,8 @@ func TestOSCommandOpenFile(t *testing.T) {
{
"filename with spaces",
func(name string, arg ...string) *exec.Cmd {
- assert.Equal(t, "open", name)
- assert.Equal(t, []string{"filename with spaces"}, arg)
+ assert.Equal(t, "bash", name)
+ assert.Equal(t, []string{"-c", `open "filename with spaces"`}, arg)
return secureexec.Command("echo")
},
func(err error) {
@@ -132,7 +132,7 @@ func TestOSCommandOpenFileLinux(t *testing.T) {
{
"test",
func(name string, arg ...string) *exec.Cmd {
- assert.Equal(t, "sh", name)
+ assert.Equal(t, "bash", name)
assert.Equal(t, []string{"-c", "xdg-open \"test\" > /dev/null"}, arg)
return secureexec.Command("echo")
},
@@ -143,7 +143,7 @@ func TestOSCommandOpenFileLinux(t *testing.T) {
{
"filename with spaces",
func(name string, arg ...string) *exec.Cmd {
- assert.Equal(t, "sh", name)
+ assert.Equal(t, "bash", name)
assert.Equal(t, []string{"-c", "xdg-open \"filename with spaces\" > /dev/null"}, arg)
return secureexec.Command("echo")
},
@@ -154,7 +154,7 @@ func TestOSCommandOpenFileLinux(t *testing.T) {
{
"let's_test_with_single_quote",
func(name string, arg ...string) *exec.Cmd {
- assert.Equal(t, "sh", name)
+ assert.Equal(t, "bash", name)
assert.Equal(t, []string{"-c", "xdg-open \"let's_test_with_single_quote\" > /dev/null"}, arg)
return secureexec.Command("echo")
},
@@ -165,7 +165,7 @@ func TestOSCommandOpenFileLinux(t *testing.T) {
{
"$USER.txt",
func(name string, arg ...string) *exec.Cmd {
- assert.Equal(t, "sh", name)
+ assert.Equal(t, "bash", name)
assert.Equal(t, []string{"-c", "xdg-open \"\\$USER.txt\" > /dev/null"}, arg)
return secureexec.Command("echo")
},
@@ -179,7 +179,7 @@ func TestOSCommandOpenFileLinux(t *testing.T) {
OSCmd := NewDummyOSCommand()
OSCmd.Command = s.command
OSCmd.Platform.OS = "linux"
- OSCmd.Config.GetUserConfig().OS.OpenCommand = `sh -c "xdg-open {{filename}} > /dev/null"`
+ OSCmd.Config.GetUserConfig().OS.OpenCommand = `xdg-open {{filename}} > /dev/null`
s.test(OSCmd.OpenFile(s.filename))
}