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

Function TestExtractForwardContext_TextPlain

internal/outbound/forward_test.go:29–54  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

27}
28
29func TestExtractForwardContext_TextPlain(t *testing.T) {
30 raw := []byte("From: alice@example.com\r\n" +
31 "To: agent@e2a.dev\r\n" +
32 "Subject: Hi\r\n" +
33 "Date: Mon, 1 Jan 2026 10:00:00 +0000\r\n" +
34 "Content-Type: text/plain; charset=utf-8\r\n" +
35 "\r\n" +
36 "hello world")
37
38 ctx := ExtractForwardContext(raw)
39 if ctx.From != "alice@example.com" {
40 t.Errorf("From = %q", ctx.From)
41 }
42 if ctx.Subject != "Hi" {
43 t.Errorf("Subject = %q", ctx.Subject)
44 }
45 if ctx.To != "agent@e2a.dev" {
46 t.Errorf("To = %q", ctx.To)
47 }
48 if ctx.Text != "hello world" {
49 t.Errorf("Text = %q", ctx.Text)
50 }
51 if ctx.HTML != "" {
52 t.Errorf("HTML = %q, want empty", ctx.HTML)
53 }
54}
55
56func TestExtractForwardContext_MultipartAlternative(t *testing.T) {
57 raw := []byte("From: alice@example.com\r\n" +

Callers

nothing calls this directly

Calls 1

ExtractForwardContextFunction · 0.85

Tested by

no test coverage detected