add failing test for erroneous apostrophed-encoding

This commit is contained in:
B. Petersen
2020-12-06 01:34:22 +01:00
committed by link2xt
parent cdb7f1dd9f
commit 8fcb8c3788
2 changed files with 41 additions and 0 deletions

View File

@@ -1604,6 +1604,17 @@ mod tests {
assert_eq!(filename, Some("Auftragsbestätigung.pdf".to_string()))
}
#[async_std::test]
async fn test_get_attachment_filename_apostrophed_invalid() {
let t = TestContext::new().await;
let mail = load_mail_with_attachment(
&t,
include_bytes!("../test-data/message/attach_filename_apostrophed_invalid.eml"),
);
let filename = get_attachment_filename(&t.ctx, &mail.subparts[1]).unwrap();
assert_eq!(filename, Some("somedäüta.html.zip".to_string()))
}
#[async_std::test]
async fn test_get_attachment_filename_combined() {
// test that if `filename` and `filename*0` are given, the filename is not doubled