From edb9ea0e835c9fd68994814d48f6b693d1168e0d Mon Sep 17 00:00:00 2001 From: link2xt Date: Sun, 11 Apr 2021 00:00:00 +0300 Subject: [PATCH] format_flowed.rs: increase line coverage to 100% --- src/format_flowed.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/format_flowed.rs b/src/format_flowed.rs index 45701cdce..abbc00fff 100644 --- a/src/format_flowed.rs +++ b/src/format_flowed.rs @@ -146,6 +146,17 @@ mod tests { let text = "> Not a quote"; assert_eq!(format_flowed(text), " > Not a quote"); + + // Test space stuffing of wrapped lines + let text = "> This is the Autocrypt Setup Message used to transfer your key between clients.\n\ + > \n\ + > To decrypt and use your key, open the message in an Autocrypt-compliant client and enter the setup code presented on the generating device."; + let expected = "\x20> This is the Autocrypt Setup Message used to transfer your key between \r\n\ + clients.\r\n\ + \x20>\r\n\ + \x20> To decrypt and use your key, open the message in an Autocrypt-compliant \r\n\ + client and enter the setup code presented on the generating device."; + assert_eq!(format_flowed(text), expected); } #[test]