From 9b5e92e64ad47c6d1b1c8ece2b428ffeea7a1639 Mon Sep 17 00:00:00 2001 From: vilmibm Date: Wed, 7 Apr 2021 14:47:12 -0500 Subject: [PATCH] make test windows friendly --- pkg/cmd/run/download/http_test.go | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pkg/cmd/run/download/http_test.go b/pkg/cmd/run/download/http_test.go index 51a7133de..a8e96153f 100644 --- a/pkg/cmd/run/download/http_test.go +++ b/pkg/cmd/run/download/http_test.go @@ -75,14 +75,14 @@ func Test_Download(t *testing.T) { var paths []string parentPrefix := tmpDir + string(filepath.Separator) - err = filepath.Walk(tmpDir, func(path string, info os.FileInfo, err error) error { + err = filepath.Walk(tmpDir, func(p string, info os.FileInfo, err error) error { if err != nil { return err } - if path == tmpDir { + if p == tmpDir { return nil } - entry := strings.TrimPrefix(path, parentPrefix) + entry := strings.TrimPrefix(p, parentPrefix) if info.IsDir() { entry += "/" } else if info.Mode()&0111 != 0 { @@ -96,11 +96,11 @@ func Test_Download(t *testing.T) { sort.Strings(paths) assert.Equal(t, []string{ "artifact/", - "artifact/bin/", - "artifact/bin/myexe", - "artifact/readme.md", - "artifact/src/", - "artifact/src/main.go", - "artifact/src/util.go", + filepath.Join("artifact", "bin") + "/", + filepath.Join("artifact", "bin", "myexe"), + filepath.Join("artifact", "readme.md"), + filepath.Join("artifact", "src") + "/", + filepath.Join("artifact", "src", "main.go"), + filepath.Join("artifact", "src", "util.go"), }, paths) }