mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-09-15 19:36:16 +00:00
Merge pull request #4137 from jfinkels/dd-bytes-suffix
dd: allow B as a suffix for count, seek, and skip
This commit is contained in:
commit
1b35e467ac
3 changed files with 126 additions and 51 deletions
|
@ -1295,3 +1295,33 @@ fn test_big_multiplication() {
|
|||
.fails()
|
||||
.stderr_contains("invalid number");
|
||||
}
|
||||
|
||||
/// Test for count, seek, and skip given in units of bytes.
|
||||
#[test]
|
||||
fn test_bytes_suffix() {
|
||||
new_ucmd!()
|
||||
.args(&["count=3B", "status=none"])
|
||||
.pipe_in("abcdef")
|
||||
.succeeds()
|
||||
.stdout_only("abc");
|
||||
new_ucmd!()
|
||||
.args(&["skip=3B", "status=none"])
|
||||
.pipe_in("abcdef")
|
||||
.succeeds()
|
||||
.stdout_only("def");
|
||||
new_ucmd!()
|
||||
.args(&["iseek=3B", "status=none"])
|
||||
.pipe_in("abcdef")
|
||||
.succeeds()
|
||||
.stdout_only("def");
|
||||
new_ucmd!()
|
||||
.args(&["seek=3B", "status=none"])
|
||||
.pipe_in("abcdef")
|
||||
.succeeds()
|
||||
.stdout_only("\0\0\0abcdef");
|
||||
new_ucmd!()
|
||||
.args(&["oseek=3B", "status=none"])
|
||||
.pipe_in("abcdef")
|
||||
.succeeds()
|
||||
.stdout_only("\0\0\0abcdef");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue