mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
od: fix zero width user input (-w0)
This commit is contained in:
parent
92fc286b0e
commit
184c4af76d
2 changed files with 19 additions and 2 deletions
|
@ -292,6 +292,23 @@ fn test_invalid_width(){
|
|||
assert_eq!(result.stdout, expected_output);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_zero_width(){
|
||||
|
||||
let input : [u8; 4] = [0x00, 0x00, 0x00, 0x00];
|
||||
let expected_output = unindent("
|
||||
0000000 000000
|
||||
0000002 000000
|
||||
0000004
|
||||
");
|
||||
|
||||
let result = new_ucmd!().arg("-w0").arg("-v").run_piped_stdin(&input[..]);
|
||||
|
||||
assert_eq!(result.stderr, "od: warning: invalid width 0; using 2 instead\n");
|
||||
assert!(result.success);
|
||||
assert_eq!(result.stdout, expected_output);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_width_without_value(){
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue