fix tests

This commit is contained in:
B. Petersen
2019-11-03 00:55:23 +01:00
committed by holger krekel
parent 3b64748427
commit e1df41c209

View File

@@ -1257,13 +1257,13 @@ mod tests {
#[ignore] #[ignore]
#[test] #[test]
fn test_dc_mailmime_parse_crash_fuzzy(data in "[!-~\t ]{2000,}") { fn test_dc_mailmime_parse_crash_fuzzy(data in "[!-~\t ]{2000,}") {
// this test doesn't exercise much of dc_mimeparser anymore
// because a missing From-field early aborts parsing
let context = dummy_context(); let context = dummy_context();
let mut mimeparser = MimeParser::new(&context.ctx); let mut mimeparser = MimeParser::new(&context.ctx);
unsafe {
assert!(mimeparser.parse(data.as_bytes()).is_err()); // parsing should always succeed
} // but the returned header will normally be empty on random data
assert!(unsafe {mimeparser.parse(data.as_bytes()).is_ok()});
assert!(mimeparser.header.is_empty());
} }
} }