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

Function TestNestedMultipartRecoversInnerText

internal/mailparse/parse_test.go:99–109  ·  view source on GitHub ↗

TestNestedMultipartRecoversInnerText: mixed wrapping alternative → inner plain.

(t *testing.T)

Source from the content-addressed store, hash-verified

97
98// TestNestedMultipartRecoversInnerText: mixed wrapping alternative → inner plain.
99func TestNestedMultipartRecoversInnerText(t *testing.T) {
100 raw := "From: a@x.com\r\nContent-Type: multipart/mixed; boundary=OUT\r\n\r\n" +
101 "--OUT\r\nContent-Type: multipart/alternative; boundary=IN\r\n\r\n" +
102 "--IN\r\nContent-Type: text/plain\r\n\r\ninner plain\r\n" +
103 "--IN\r\nContent-Type: text/html\r\n\r\n<p>inner html</p>\r\n--IN--\r\n" +
104 "--OUT--\r\n"
105 got, _ := ParsedBody([]byte(raw), 0)
106 if got != "inner plain" {
107 t.Fatalf("nested multipart: got %q, want %q", got, "inner plain")
108 }
109}
110
111// TestBase64Decoded: a base64 text/plain part is decoded.
112func TestBase64Decoded(t *testing.T) {

Callers

nothing calls this directly

Calls 1

ParsedBodyFunction · 0.85

Tested by

no test coverage detected