(t *testing.T)
| 53 | } |
| 54 | |
| 55 | func TestParseEmail_Multipart(t *testing.T) { |
| 56 | raw := []byte("From: sender@example.com\r\nTo: recipient@example.com\r\nSubject: Multipart Test\r\nContent-Type: multipart/alternative; boundary=\"boundary123\"\r\nMessage-ID: <multi@example.com>\r\n\r\n--boundary123\r\nContent-Type: text/plain\r\n\r\nPlain text body\r\n--boundary123\r\nContent-Type: text/html\r\n\r\n<p>HTML body</p>\r\n--boundary123--") |
| 57 | |
| 58 | parsed, _, err := parseEmail(raw, []string{"recipient@example.com"}) |
| 59 | if err != nil { |
| 60 | t.Fatal(err) |
| 61 | } |
| 62 | if !strings.Contains(parsed.Text, "Plain text body") { |
| 63 | t.Errorf("Text = %q", parsed.Text) |
| 64 | } |
| 65 | if !strings.Contains(parsed.HTML, "HTML body") { |
| 66 | t.Errorf("HTML = %q", parsed.HTML) |
| 67 | } |
| 68 | } |
| 69 | |
| 70 | func TestParseEmail_BCC(t *testing.T) { |
| 71 | raw := []byte("From: sender@example.com\r\nTo: visible@example.com\r\nSubject: BCC Test\r\nContent-Type: text/plain\r\n\r\ntest") |
nothing calls this directly
no test coverage detected