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

od: implement +size to skip bytes

This commit is contained in:
Wim Hueskes 2016-08-16 00:37:33 +02:00
parent 9e33c3a48c
commit 26ec46835c
3 changed files with 322 additions and 21 deletions

View file

@ -564,3 +564,30 @@ fn test_filename_parsing(){
000012
"));
}
#[test]
fn test_stdin_offset(){
let input = "abcdefghijklmnopq";
let result = new_ucmd!().arg("-c").arg("+5").run_piped_stdin(input.as_bytes());
assert_empty_stderr!(result);
assert!(result.success);
assert_eq!(result.stdout, unindent("
0000005 f g h i j k l m n o p q
0000021
"));
}
#[test]
fn test_file_offset(){
let result = new_ucmd!().arg("-c").arg("--").arg("-f").arg("10").run();
assert_empty_stderr!(result);
assert!(result.success);
assert_eq!(result.stdout, unindent(r"
0000010 w e r c a s e f \n
0000022
"));
}