1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

od: do not panic on empty address radix

This commit is contained in:
Andrew Liebenow 2024-09-01 07:59:19 -05:00
parent dfe3e38063
commit 04cd36f022
2 changed files with 31 additions and 16 deletions

View file

@ -579,6 +579,15 @@ fn test_invalid_offset() {
new_ucmd!().arg("-Ab").fails();
}
#[test]
fn test_empty_offset() {
new_ucmd!()
.arg("-A")
.arg("")
.fails()
.stderr_only("od: Radix cannot be empty, and must be one of [o, d, x, n]\n");
}
#[test]
fn test_offset_compatibility() {
let input = [0u8; 4];
@ -586,10 +595,9 @@ fn test_offset_compatibility() {
new_ucmd!()
.arg("-Anone")
.run_piped_stdin(input)
.no_stderr()
.success()
.stdout_is(expected_output);
.pipe_in(input)
.succeeds()
.stdout_only(expected_output);
}
#[test]