package provision import ( "slices" "testing" ) // Every registry app names the one prefix whose From its switched binary // reads: CARLOS_SMTP (mail.FromCarlos("CARLOS")) for all but Docs, which // reads DOCS_SMTP's. The prefix is one the binary also reads on SMTP, so // a declaration that works on SMTP keeps working when switched. func TestEveryAppNamesTheFromItsBinaryReads(t *testing.T) { want := map[string]string{"docs": "DOCS_SMTP"} for _, a := range Apps { w := want[a.Slug] if w == "" { w = "CARLOS_SMTP" } if a.SubmitPrefix != w { t.Errorf("%s: SubmitPrefix %q, want %q", a.Slug, a.SubmitPrefix, w) } if !slices.Contains(a.MailPrefixes, a.SubmitPrefix) { t.Errorf("%s: SubmitPrefix %q is not one of its SMTP prefixes %v", a.Slug, a.SubmitPrefix, a.MailPrefixes) } } }