fix: env var test updated for panic

This commit is contained in:
Slug-Boi
2025-06-03 19:59:00 +02:00
parent ff9b8739cb
commit 0da8fc6998
+3 -7
View File
@@ -173,14 +173,10 @@ func Test_FindAuthorFileEnv(t *testing.T) {
// Test Find_authorfile with env var // Test Find_authorfile with env var
setup() setup()
defer teardown() defer teardown()
os.Setenv("author_file", "") os.Setenv("author_file", "author_file_test")
authorfile := utils.Find_authorfile() authorfile := utils.Find_authorfile()
configdir, err := os.UserConfigDir() if authorfile != "author_file_test" {
if err != nil { t.Errorf("Find_authorfile() = %v; want %v", authorfile, "author_file_test")
t.Fatalf("Failed to get user config directory: %v", err)
}
if authorfile != configdir+"/cocommit/authors.json" {
t.Errorf("Find_authorfile() = %v; want %v", authorfile, configdir+"/cocommit/authors.json")
} }
} }