mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
od: suppress duplicates
This commit is contained in:
parent
80386ef04f
commit
4770690823
2 changed files with 44 additions and 7 deletions
|
@ -266,7 +266,7 @@ fn test_width(){
|
|||
0000010
|
||||
");
|
||||
|
||||
let result = new_ucmd!().arg("-w4").run_piped_stdin(&input[..]);
|
||||
let result = new_ucmd!().arg("-w4").arg("-v").run_piped_stdin(&input[..]);
|
||||
|
||||
assert_empty_stderr!(result);
|
||||
assert!(result.success);
|
||||
|
@ -283,7 +283,7 @@ fn test_invalid_width(){
|
|||
0000004
|
||||
");
|
||||
|
||||
let result = new_ucmd!().arg("-w5").run_piped_stdin(&input[..]);
|
||||
let result = new_ucmd!().arg("-w5").arg("-v").run_piped_stdin(&input[..]);
|
||||
|
||||
assert_eq!(result.stderr, "od: warning: invalid width 5; using 2 instead\n");
|
||||
assert!(result.success);
|
||||
|
@ -306,3 +306,23 @@ fn test_width_without_value(){
|
|||
assert!(result.success);
|
||||
assert_eq!(result.stdout, expected_output);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_suppress_duplicates(){
|
||||
|
||||
let input = [0u8 ; 41];
|
||||
let expected_output = unindent("
|
||||
0000000 000000000000
|
||||
0000 0000
|
||||
*
|
||||
0000050 000000000000
|
||||
0000
|
||||
0000051
|
||||
");
|
||||
|
||||
let result = new_ucmd!().arg("-w4").arg("-O").arg("-x").run_piped_stdin(&input[..]);
|
||||
|
||||
assert_empty_stderr!(result);
|
||||
assert!(result.success);
|
||||
assert_eq!(result.stdout, expected_output);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue