package listunsubscribe import "testing" func TestParse_mailtoHeader(t *testing.T) { got := Parse("") if got.Mailto == nil || got.Mailto.Address != "opposition@vertical-mail.com" { t.Fatalf("Parse() mailto = %+v", got.Mailto) } } func TestParse_mailtoWithHttp(t *testing.T) { got := Parse(", ") if got.Mailto == nil || got.Mailto.Address != "a@b.com" { t.Fatalf("mailto = %+v", got.Mailto) } if got.Mailto.Subject != "unsub" { t.Fatalf("subject = %q", got.Mailto.Subject) } if got.HTTP != "https://example.com/unsub" { t.Fatalf("http = %q", got.HTTP) } }