MCPcopy Index your code
hub / github.com/foxcpp/maddy / CheckMsgID

Function CheckMsgID

internal/testutils/target.go:332–352  ·  view source on GitHub ↗
(t *testing.T, msg *Msg, sender string, rcpt []string, id string)

Source from the content-addressed store, hash-verified

330}
331
332func CheckMsgID(t *testing.T, msg *Msg, sender string, rcpt []string, id string) string {
333 t.Helper()
334
335 if msg.MsgMeta.ID != id && id != "" {
336 t.Errorf("empty or wrong delivery context for passed message? %+v", msg.MsgMeta)
337 }
338 if msg.MailFrom != sender {
339 t.Errorf("wrong sender, want %s, got %s", sender, msg.MailFrom)
340 }
341
342 sort.Strings(rcpt)
343 sort.Strings(msg.RcptTo)
344 if !reflect.DeepEqual(msg.RcptTo, rcpt) {
345 t.Errorf("wrong recipients, want %v, got %v", rcpt, msg.RcptTo)
346 }
347 if string(msg.Body) != "foobar\r\n" {
348 t.Errorf("wrong body, want '%s', got '%s' (%v)", "foobar\r\n", string(msg.Body), msg.Body)
349 }
350
351 return msg.MsgMeta.ID
352}

Calls

no outgoing calls