add test for apostrophed-encoded filenames

This commit is contained in:
B. Petersen
2020-12-03 01:10:03 +01:00
parent 966712019f
commit b510d74c4a
3 changed files with 76 additions and 0 deletions

View File

@@ -1527,6 +1527,24 @@ mod tests {
assert_eq!(filename, Some("=?utf-8?q?foo?=.bar".to_string()))
}
#[test]
fn test_get_attachment_filename_apostrophed() {
let mail = load_mail_with_attachment(include_bytes!(
"../test-data/message/attach_filename_apostrophed.eml"
));
let filename = get_attachment_filename(&mail.subparts[1]).unwrap();
assert_eq!(filename, Some("Maßnahmen Okt. 2021.html".to_string()))
}
#[test]
fn test_get_attachment_filename_apostrophed_cont() {
let mail = load_mail_with_attachment(include_bytes!(
"../test-data/message/attach_filename_apostrophed_cont.eml"
));
let filename = get_attachment_filename(&mail.subparts[1]).unwrap();
assert_eq!(filename, Some("Maßnahmen März 2022.html".to_string()))
}
#[test]
fn test_get_attachment_filename_combined() {
// test that if `filename` and `filename*0` are given, the filename is not doubled