Add property test for simplify_plain_text

This commit is contained in:
Dmitry Bogatov
2019-09-17 16:50:37 +00:00
committed by holger krekel
parent b3b1e37192
commit d644ca5563

View File

@@ -211,6 +211,16 @@ fn is_plain_quote(buf: &str) -> bool {
#[cfg(test)]
mod tests {
use super::*;
use proptest::prelude::*;
proptest! {
#[test]
// proptest does not support [[:graphical:][:space:]] regex.
fn test_simplify_plain_text_fuzzy(input in "[!-~\t \n]+") {
let output = Simplify::new().simplify_plain_text(&input, true);
assert!(output.split('\n').all(|s| s != "-- "));
}
}
#[test]
fn test_simplify_trim() {