summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorAlexandros Frantzis <alf82@freemail.gr>2019-10-05 21:11:35 +0300
committerAlexandros Frantzis <alf82@freemail.gr>2019-10-06 17:16:01 +0300
commit6db5a3fffdfe049a57a24781088d817b11d3cab1 (patch)
tree960026934fc0d4a0c049379685be55217b4b98a8 /tests
parenta054789ddb60ed1fab26e6d4e6bd36ed926273f1 (diff)
Fix folding of boundary lines
Ensure boundary lines are not folded with preceding decoded text.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_encoding.rs8
1 files changed, 8 insertions, 0 deletions
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
@@ -106,6 +106,14 @@ fn base64_parts_are_decoded() {
}
#[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();