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

Function TestExtractThreadInfo

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

Source from the content-addressed store, hash-verified

44}
45
46func TestExtractThreadInfo(t *testing.T) {
47 raw := []byte("Message-Id: <abc123@gmail.com>\r\nSubject: Hello Agent\r\nFrom: alice@example.com\r\nTo: bot@agent.example.com\r\n\r\nHi there\r\n")
48
49 info := extractThreadInfo(raw)
50
51 if info.MessageID != "<abc123@gmail.com>" {
52 t.Errorf("MessageID = %q, want %q", info.MessageID, "<abc123@gmail.com>")
53 }
54 if info.Subject != "Hello Agent" {
55 t.Errorf("Subject = %q, want %q", info.Subject, "Hello Agent")
56 }
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")

Callers

nothing calls this directly

Calls 1

extractThreadInfoFunction · 0.85

Tested by

no test coverage detected