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

od: fix parsing of hex input ending with E

This commit is contained in:
Damon Harris 2023-06-18 07:41:11 +05:30
parent 07c538f090
commit b7154a80e1
2 changed files with 31 additions and 1 deletions

View file

@ -627,6 +627,35 @@ fn test_skip_bytes() {
));
}
#[test]
fn test_skip_bytes_hex() {
let input = "abcdefghijklmnopq"; // spell-checker:disable-line
new_ucmd!()
.arg("-c")
.arg("--skip-bytes=0xB")
.run_piped_stdin(input.as_bytes())
.no_stderr()
.success()
.stdout_is(unindent(
"
0000013 l m n o p q
0000021
",
));
new_ucmd!()
.arg("-c")
.arg("--skip-bytes=0xE")
.run_piped_stdin(input.as_bytes())
.no_stderr()
.success()
.stdout_is(unindent(
"
0000016 o p q
0000021
",
));
}
#[test]
fn test_skip_bytes_error() {
let input = "12345";