[core] V0.1: parse, compose, reply/forward, safe names, threading, rules + Sieve, sanitiser, search (55 tests green)

This commit is contained in:
2026-11-08 14:11:27 +01:00
parent c59480a0c0
commit e98e626c76
14 changed files with 1276 additions and 75 deletions
+7 -4
View File
@@ -144,7 +144,11 @@ fn body_text() -> impl Strategy<Value = String> {
fn attachment() -> impl Strategy<Value = OutAttachment> {
(
"[A-Za-z0-9_-]{1,20}",
prop_oneof![Just(("pdf", "application/pdf")), Just(("png", "image/png")), Just(("bin", "application/octet-stream"))],
prop_oneof![
Just(("pdf", "application/pdf")),
Just(("png", "image/png")),
Just(("bin", "application/octet-stream"))
],
proptest::collection::vec(any::<u8>(), 0..3000),
)
.prop_map(|(stem, (ext, ct), data)| OutAttachment {
@@ -165,9 +169,8 @@ fn draft() -> impl Strategy<Value = Draft> {
proptest::collection::vec(attachment(), 0..3),
)
.prop_map(|(from, to, cc, subject, text, with_html, attachments)| {
let html = with_html.then(|| {
format!("<p>{}</p>", text.replace('&', "&amp;").replace('<', "&lt;").replace('\n', "<br>"))
});
let html = with_html
.then(|| format!("<p>{}</p>", text.replace('&', "&amp;").replace('<', "&lt;").replace('\n', "<br>")));
Draft { from, to, cc, subject, text, html, attachments, ..Default::default() }
})
}