From 6db5a3fffdfe049a57a24781088d817b11d3cab1 Mon Sep 17 00:00:00 2001 From: Alexandros Frantzis Date: Sat, 5 Oct 2019 21:11:35 +0300 Subject: Fix folding of boundary lines Ensure boundary lines are not folded with preceding decoded text. --- tests/test_encoding.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'tests') diff --git a/tests/test_encoding.rs b/tests/test_encoding.rs index 1579449..9b339b5 100644 --- a/tests/test_encoding.rs +++ b/tests/test_encoding.rs @@ -105,6 +105,14 @@ fn base64_parts_are_decoded() { assert!(email.body().search(r"are challenged by this point of pale light").unwrap()); } +#[test] +fn base64_boundaries_remain_on_their_own_line() { + let email = Email::from_vec(TEST_EMAIL_MULTIPART.to_string().into_bytes()).unwrap(); + + assert!(!email.data().search(r"[^\n]--XtT01VFrJIenjlg\+ZCXSSWq4").unwrap()); + assert!(!email.data().search(r"[^\n]--2c\+OeCbICgJrtINI5EFlsI6G").unwrap()); +} + #[test] fn non_text_base64_is_not_decoded() { let email = Email::from_vec(TEST_EMAIL_MULTIPART.to_string().into_bytes()).unwrap(); -- cgit v1.2.3