mirror of
https://github.com/chatmail/core.git
synced 2026-05-19 14:56:33 +03:00
Add property test for simplify_plain_text
This commit is contained in:
committed by
holger krekel
parent
b3b1e37192
commit
d644ca5563
@@ -211,6 +211,16 @@ fn is_plain_quote(buf: &str) -> bool {
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
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]
|
#[test]
|
||||||
fn test_simplify_trim() {
|
fn test_simplify_trim() {
|
||||||
|
|||||||
Reference in New Issue
Block a user