From e816f4b3f0b350fc39de2a4052fad1b6f219eb1d Mon Sep 17 00:00:00 2001 From: Jason Date: Mon, 2 Sep 2024 21:46:31 +1000 Subject: [PATCH] test(dir): fix failing unit test Signed-off-by: Jason --- dir/path_test.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dir/path_test.go b/dir/path_test.go index ffa20c01..b3ffc1a5 100644 --- a/dir/path_test.go +++ b/dir/path_test.go @@ -14,6 +14,7 @@ package dir import ( + "os" "path/filepath" "testing" ) @@ -45,9 +46,11 @@ func Test_UserConfigDirPath(t *testing.T) { func Test_NoHomeVariable(t *testing.T) { t.Setenv("HOME", "") - userConfigDir := UserConfigDirPath() - if userConfigDir != "notation" { - t.Fatalf(`UserConfigDirPath() = %q, want "notation"`, userConfigDir) + UserConfigDir = "" + userConfigDir = os.UserConfigDir + got := UserConfigDirPath() + if got != "notation" { + t.Fatalf(`UserConfigDirPath() = %q, want "notation"`, UserConfigDir) } }