fix: respect $XDG_CONFIG_HOME
This commit is contained in:
parent
527f6bf15f
commit
2ea1bff59d
2 changed files with 17 additions and 0 deletions
|
|
@ -75,6 +75,20 @@ func TestGetConfigDir(t *testing.T) {
|
|||
}
|
||||
}
|
||||
|
||||
func TestGetConfigDir_XDG(t *testing.T) {
|
||||
t.Setenv("XDG_CONFIG_HOME", "/custom/config")
|
||||
|
||||
dir, err := GetConfigDir()
|
||||
if err != nil {
|
||||
t.Fatalf("Unexpected error: %v", err)
|
||||
}
|
||||
|
||||
expected := "/custom/config/fgj"
|
||||
if dir != expected {
|
||||
t.Errorf("Expected %q, got %q", expected, dir)
|
||||
}
|
||||
}
|
||||
|
||||
func TestGetConfigPath(t *testing.T) {
|
||||
path, err := GetConfigPath()
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue