From 7b326d72b127d095f25ad0effd7638979e1a8f60 Mon Sep 17 00:00:00 2001 From: Justin Hawkins Date: Tue, 28 Nov 2023 20:31:39 +1030 Subject: [PATCH] THis time for sure --- download/download_test.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/download/download_test.go b/download/download_test.go index 69fd1f4..18cd2ba 100644 --- a/download/download_test.go +++ b/download/download_test.go @@ -3,6 +3,7 @@ package download import ( "os" "os/exec" + "path/filepath" "strings" "sync" "testing" @@ -370,6 +371,7 @@ func TestLookForExecutable(t *testing.T) { t.Errorf("cannot run this test without knowing about sleep: %s", err) t.FailNow() } + cmdDir := filepath.Dir(cmdPath) cmd := "sleep" path, err := absPathToExecutable(cmd) @@ -377,7 +379,7 @@ func TestLookForExecutable(t *testing.T) { assert.Equal(t, cmdPath, path) } - cmd = "/bin/sleep" + cmd = cmdPath path, err = absPathToExecutable(cmd) if assert.NoError(t, err) { assert.Equal(t, cmdPath, path) @@ -392,7 +394,7 @@ func TestLookForExecutable(t *testing.T) { _, err = absPathToExecutable(cmd) assert.Error(t, err) - os.Chdir("/bin") + os.Chdir(cmdDir) cmd = "./sleep" path, err = absPathToExecutable(cmd) if assert.NoError(t, err) {