From d81984b4c6ec01ae4fcbe7a3a55837b48b317f05 Mon Sep 17 00:00:00 2001 From: Bezalel Brandwine Date: Thu, 14 Oct 2021 13:28:10 +0300 Subject: [PATCH] try to adapt path to windows --- policyhandler/filesloader_test.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/policyhandler/filesloader_test.go b/policyhandler/filesloader_test.go index 26772eb6..681488b2 100644 --- a/policyhandler/filesloader_test.go +++ b/policyhandler/filesloader_test.go @@ -4,18 +4,22 @@ import ( "fmt" "os" "path" + "path/filepath" "strings" "testing" ) func onlineBoutiquePath() string { o, _ := os.Getwd() - return path.Join(o+"/..", "examples/online-boutique/*") + return filepath.Join(path.Dir(o), "examples/online-boutique/*") } func TestListFiles(t *testing.T) { workDir, err := os.Getwd() fmt.Printf("\n------------------\n%s,%v\n--------------\n", workDir, err) - files, errs := listFiles([]string{onlineBoutiquePath()}) + filesPath := onlineBoutiquePath() + fmt.Printf("\n------------------\n%s\n--------------\n", filesPath) + + files, errs := listFiles([]string{filesPath}) if len(errs) > 0 { t.Error(errs) }