TestNestedMultipartRecoversInnerText: mixed wrapping alternative → inner plain.
(t *testing.T)
| 97 | |
| 98 | // TestNestedMultipartRecoversInnerText: mixed wrapping alternative → inner plain. |
| 99 | func 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. |
| 112 | func TestBase64Decoded(t *testing.T) { |
nothing calls this directly
no test coverage detected