chore: remove old and unused code

This commit is contained in:
2026-08-03 13:08:18 +02:00
parent 312b25fd39
commit 4fcc479779
17 changed files with 325 additions and 142 deletions

View File

@@ -233,7 +233,6 @@ func TestLoadConfigRejectsUnknownSettings(t *testing.T) {
func TestConfigPathHonorsEnvironmentOverride(t *testing.T) {
t.Setenv("DIPLE_CONFIG", "/tmp/custom-diple.toml")
t.Setenv("GH_THREADS_CONFIG", "")
got, err := configPath()
if err != nil {
t.Fatal(err)
@@ -243,18 +242,6 @@ func TestConfigPathHonorsEnvironmentOverride(t *testing.T) {
}
}
func TestConfigPathHonorsLegacyEnvironmentOverride(t *testing.T) {
t.Setenv("DIPLE_CONFIG", "")
t.Setenv("GH_THREADS_CONFIG", "/tmp/legacy-gh-threads.toml")
got, err := configPath()
if err != nil {
t.Fatal(err)
}
if got != "/tmp/legacy-gh-threads.toml" {
t.Fatalf("legacy config path = %q", got)
}
}
func TestExistingConfigPathFallsBackToDotConfig(t *testing.T) {
root := t.TempDir()
preferred := filepath.Join(root, "Library", "Application Support", "diple", "config.toml")
@@ -280,23 +267,7 @@ func TestExistingConfigPathFallsBackToDotConfig(t *testing.T) {
}
}
func TestFirstExistingConfigPathFallsBackToLegacyName(t *testing.T) {
root := t.TempDir()
current := filepath.Join(root, "diple", "config.toml")
legacy := filepath.Join(root, "gh-threads", "config.toml")
if err := os.MkdirAll(filepath.Dir(legacy), 0o700); err != nil {
t.Fatal(err)
}
if err := os.WriteFile(legacy, []byte("theme = \"dark\"\n"), 0o600); err != nil {
t.Fatal(err)
}
if got := firstExistingOrDefault(current, legacy); got != legacy {
t.Fatalf("migration config path = %q, want %q", got, legacy)
}
}
func TestConfigPathHonorsXDGConfigHome(t *testing.T) {
t.Setenv("GH_THREADS_CONFIG", "")
t.Setenv("DIPLE_CONFIG", "")
t.Setenv("XDG_CONFIG_HOME", "/tmp/xdg-config")
got, err := configPath()