package config import ( "path/filepath" "runtime" "testing" ) func isolateConfigHome(t *testing.T, home string) { t.Helper() resetGlobalConfig() t.Cleanup(resetGlobalConfig) for _, key := range []string{"HOME", "USERPROFILE", "APPDATA", "LOCALAPPDATA"} { t.Setenv(key, home) } t.Setenv("XDG_CONFIG_HOME", filepath.Join(home, ".config")) } func testConfigDir(home string) string { if runtime.GOOS == "windows" { return filepath.Join(home, "mpv", "portable_config") } return filepath.Join(home, ".config", "mpv") }