diff --git a/dir/path_test.go b/dir/path_test.go index 638966eb..ffa20c01 100644 --- a/dir/path_test.go +++ b/dir/path_test.go @@ -43,6 +43,14 @@ 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) + } +} + func Test_UserLibexecDirPath(t *testing.T) { userConfigDir = mockGetUserConfig got := UserLibexecDirPath() @@ -51,7 +59,6 @@ func Test_UserLibexecDirPath(t *testing.T) { } } - func TestLocalKeyPath(t *testing.T) { userConfigDir = mockGetUserConfig loadUserPath()