MCPcopy Create free account
hub / github.com/Mnexa-AI/e2a / TestExtractThreadInfoWithReplyHeaders

Function TestExtractThreadInfoWithReplyHeaders

internal/relay/server_test.go:59–73  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

57}
58
59func TestExtractThreadInfoWithReplyHeaders(t *testing.T) {
60 raw := []byte("Message-Id: <reply@gmail.com>\r\nSubject: Re: Hello\r\nIn-Reply-To: <orig@agent.com>\r\nReferences: <first@agent.com> <orig@agent.com>\r\nFrom: alice@example.com\r\nTo: bot@agent.example.com\r\n\r\nReply body\r\n")
61
62 info := extractThreadInfo(raw)
63
64 if info.InReplyTo != "<orig@agent.com>" {
65 t.Errorf("InReplyTo = %q, want %q", info.InReplyTo, "<orig@agent.com>")
66 }
67 if len(info.References) != 2 {
68 t.Fatalf("References count = %d, want 2", len(info.References))
69 }
70 if info.References[0] != "<first@agent.com>" {
71 t.Errorf("References[0] = %q, want %q", info.References[0], "<first@agent.com>")
72 }
73}
74
75func TestExtractThreadInfoReplyTo(t *testing.T) {
76 // Outbound messages from the e2a relay set From: to the platform alias and

Callers

nothing calls this directly

Calls 1

extractThreadInfoFunction · 0.85

Tested by

no test coverage detected