Skip to content

Commit

Permalink
test: add a regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
Yassir Barchi authored and paolobarbolini committed Mar 27, 2024
1 parent ccaf5a7 commit dbb1358
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 @@ -351,4 +351,24 @@ mod tests {
)
);
}

#[test]
fn double_spaces_issue_949() {
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("BBBBBBBBBBBBB ").unwrap();
crate::headers::rfc2047::encode("sélection", &mut w).unwrap();
}

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

0 comments on commit dbb1358

Please sign in to comment.