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

Function TestExtractThreadInfoToCcLists

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

Source from the content-addressed store, hash-verified

114}
115
116func TestExtractThreadInfoToCcLists(t *testing.T) {
117 raw := []byte("Message-Id: <m@gmail.com>\r\nSubject: Group\r\nFrom: alice@example.com\r\n" +
118 "To: \"Bot A\" <bot-a@example.com>, bot-b@example.com\r\n" +
119 "Cc: watcher@example.com\r\n\r\nbody\r\n")
120
121 info := extractThreadInfo(raw)
122
123 wantTo := []string{"bot-a@example.com", "bot-b@example.com"}
124 if !reflect.DeepEqual(info.To, wantTo) {
125 t.Errorf("To = %v, want %v", info.To, wantTo)
126 }
127 if !reflect.DeepEqual(info.CC, []string{"watcher@example.com"}) {
128 t.Errorf("CC = %v, want [watcher@example.com]", info.CC)
129 }
130}
131
132func TestExtractAddressListEmptyAndMalformed(t *testing.T) {
133 if got := extractAddressList(""); got != nil {

Callers

nothing calls this directly

Calls 1

extractThreadInfoFunction · 0.85

Tested by

no test coverage detected