Skip to content

Commit

Permalink
test(rfc2047): add second test
Browse files Browse the repository at this point in the history
  • Loading branch information
paolobarbolini committed Mar 27, 2024
1 parent c128b46 commit 4634f41
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/headers/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -365,4 +365,24 @@ mod tests {
)
);
}

#[test]
fn double_spaces_issue_949_no_space() {
let mut s = "Subject: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA ".to_string();
let line_len = s.len();

{
let mut w = EmailWriter::new(&mut s, line_len, 0, false, true);
w.folding().write_str("BBBBBBBBBBBBBBB").unwrap();
crate::headers::rfc2047::encode("sélection", &mut w).unwrap();
}

assert_eq!(
s,
concat!(
"Subject: AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA BBBBBBBBBBBBBBB=?utf-8?b?cw==?=\r\n",
" =?utf-8?b?w6lsZWN0aW9u?=",
)
);
}
}

0 comments on commit 4634f41

Please sign in to comment.