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

od: accept shortcuts for stringly-enum arguments

This commit is contained in:
Ben Wiederhake 2024-04-01 08:06:18 +02:00
parent 2646944bee
commit 1dd7d8e0db
2 changed files with 26 additions and 1 deletions

View file

@ -53,6 +53,20 @@ fn test_file() {
.no_stderr()
.stdout_is(unindent(ALPHA_OUT));
new_ucmd!()
.arg("--endian=littl") // spell-checker:disable-line
.arg(file.as_os_str())
.succeeds()
.no_stderr()
.stdout_is(unindent(ALPHA_OUT));
new_ucmd!()
.arg("--endian=l")
.arg(file.as_os_str())
.succeeds()
.no_stderr()
.stdout_is(unindent(ALPHA_OUT));
// Ensure that default format matches `-t o2`, and that `-t` does not absorb file argument
new_ucmd!()
.arg("--endian=little")
@ -463,6 +477,16 @@ fn test_big_endian() {
.run_piped_stdin(&input[..])
.no_stderr()
.success()
.stdout_is(&expected_output);
new_ucmd!()
.arg("--endian=b")
.arg("-F")
.arg("-f")
.arg("-X")
.arg("-x")
.run_piped_stdin(&input[..])
.no_stderr()
.success()
.stdout_is(expected_output);
}