[core] V0.1: parse, compose, reply/forward, safe names, threading, rules + Sieve, sanitiser, search (55 tests green)
This commit is contained in:
+7
-4
@@ -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('&', "&").replace('<', "<").replace('\n', "<br>"))
|
||||
});
|
||||
let html = with_html
|
||||
.then(|| format!("<p>{}</p>", text.replace('&', "&").replace('<', "<").replace('\n', "<br>")));
|
||||
Draft { from, to, cc, subject, text, html, attachments, ..Default::default() }
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user