mirror of
https://github.com/uutils/coreutils
synced 2024-11-16 09:48:03 +00:00
Merge pull request #821 from ebfe/cat-test
tests/cat: --squeeze-blank test
This commit is contained in:
commit
267a7d043a
1 changed files with 11 additions and 1 deletions
12
tests/cat.rs
12
tests/cat.rs
|
@ -28,7 +28,7 @@ fn test_output_multi_files_print_all_chars() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_stdin_squeeze() {
|
fn test_stdin_show_all() {
|
||||||
let (_, mut ucmd) = testing(UTIL_NAME);
|
let (_, mut ucmd) = testing(UTIL_NAME);
|
||||||
let out = ucmd.arg("-A")
|
let out = ucmd.arg("-A")
|
||||||
.run_piped_stdin("\x00\x01\x02".as_bytes())
|
.run_piped_stdin("\x00\x01\x02".as_bytes())
|
||||||
|
@ -37,6 +37,16 @@ fn test_stdin_squeeze() {
|
||||||
assert_eq!(out, "^@^A^B");
|
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]
|
#[test]
|
||||||
fn test_stdin_number_non_blank() {
|
fn test_stdin_number_non_blank() {
|
||||||
let (_, mut ucmd) = testing(UTIL_NAME);
|
let (_, mut ucmd) = testing(UTIL_NAME);
|
||||||
|
|
Loading…
Reference in a new issue