diff --git a/msgwriter_test.go b/msgwriter_test.go index d72c40c..3fd158c 100644 --- a/msgwriter_test.go +++ b/msgwriter_test.go @@ -346,8 +346,15 @@ func TestMsgWriter_addFiles(t *testing.T) { if msgwriter.err != nil { t.Errorf("msgWriter failed to write: %s", msgwriter.err) } - ctExpect := fmt.Sprintf(`Content-Type: text/plain; charset=utf-8; name="%s"`, tt.expect) + + var ctExpect string cdExpect := fmt.Sprintf(`Content-Disposition: attachment; filename="%s"`, tt.expect) + switch runtime.GOOS { + case "freebsd": + ctExpect = fmt.Sprintf(`Content-Type: application/octet-stream; charset=utf-8; name="%s"`, tt.expect) + default: + ctExpect = fmt.Sprintf(`Content-Type: text/plain; charset=utf-8; name="%s"`, tt.expect) + } if !strings.Contains(buffer.String(), ctExpect) { t.Errorf("expected content-type: %q, got: %q", ctExpect, buffer.String()) }