From d644ca5563904cf22f4315f8fba4a0e8dadc8877 Mon Sep 17 00:00:00 2001 From: Dmitry Bogatov Date: Tue, 17 Sep 2019 16:50:37 +0000 Subject: [PATCH] Add property test for simplify_plain_text --- src/dc_simplify.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/dc_simplify.rs b/src/dc_simplify.rs index c32ccbb19..e2c355a42 100644 --- a/src/dc_simplify.rs +++ b/src/dc_simplify.rs @@ -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() {