From c0d91d225f794a2a805ae24e9b0e3cefeb5b01c9 Mon Sep 17 00:00:00 2001 From: Michael Gehring Date: Wed, 17 Feb 2016 08:06:28 +0100 Subject: [PATCH] tests/cat: --squeeze-blank test --- tests/cat.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/cat.rs b/tests/cat.rs index 8b55cfc5f..af538f6ba 100644 --- a/tests/cat.rs +++ b/tests/cat.rs @@ -28,7 +28,7 @@ fn test_output_multi_files_print_all_chars() { } #[test] -fn test_stdin_squeeze() { +fn test_stdin_show_all() { let (_, mut ucmd) = testing(UTIL_NAME); let out = ucmd.arg("-A") .run_piped_stdin("\x00\x01\x02".as_bytes()) @@ -37,6 +37,16 @@ fn test_stdin_squeeze() { assert_eq!(out, "^@^A^B"); } +#[test] +fn test_stdin_squeeze_blank() { + let (_, mut ucmd) = testing(UTIL_NAME); + let out = ucmd.arg("--squeeze-blank") + .run_piped_stdin("\n\na\n\n\n\n\nb\n\n\n".as_bytes()) + .stdout; + + assert_eq!(out, "\na\n\nb\n\n"); +} + #[test] fn test_stdin_number_non_blank() { let (_, mut ucmd) = testing(UTIL_NAME);