(t *testing.T)
| 27 | } |
| 28 | |
| 29 | func 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 | |
| 56 | func TestExtractForwardContext_MultipartAlternative(t *testing.T) { |
| 57 | raw := []byte("From: alice@example.com\r\n" + |
nothing calls this directly
no test coverage detected