test: add tests for handler, email, cmd/server, version and enforce 80% coverage

This commit is contained in:
2026-07-26 20:59:56 +02:00
parent 08554695da
commit 4dd7b6991d
8 changed files with 1295 additions and 6 deletions
+13
View File
@@ -95,3 +95,16 @@ to = "you@example.com"
t.Fatal("expected an error for an unknown field")
}
}
func TestConfigPath(t *testing.T) {
if got := ConfigPath(); got != "/etc/nuntius/config.toml" {
t.Errorf("ConfigPath() = %q, want %q", got, "/etc/nuntius/config.toml")
}
}
func TestSMTPConfigAddrFor(t *testing.T) {
smtp := SMTPConfig{Host: "smtp.example.com", Port: 587}
if got := smtp.AddrFor(); got != "smtp.example.com:587" {
t.Errorf("AddrFor() = %q, want %q", got, "smtp.example.com:587")
}
}