refactor: remove dead code

This commit is contained in:
James Houlahan
2020-08-14 15:31:16 +02:00
parent 9821b5bbc2
commit 9ba08e5edb
4 changed files with 13 additions and 64 deletions

View File

@ -36,26 +36,6 @@ func TestParserWrite(t *testing.T) {
assert.Equal(t, s("text_html_octet_attachment.eml"), crlf(buf.String()))
}
func TestParserWriteNoAttachments(t *testing.T) {
p := newTestParser(t, "text_html_octet_attachment.eml")
w := p.
NewWriter().
WithCondition(func(p *Part) bool {
// We don't write if the content disposition says it's an attachment.
if disp, _, err := p.Header.ContentDisposition(); err == nil && disp == "attachment" {
return false
}
return true
})
buf := new(bytes.Buffer)
assert.NoError(t, w.Write(buf))
assert.Equal(t, s("text_html.eml"), crlf(buf.String()))
}
func crlf(s string) string {
return strings.ReplaceAll(s, "\r\n", "\n")
}