mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-09-16 19:56:17 +00:00
Merge pull request #3066 from jfinkels/dd-skip-beyond-file
dd: show warning if skipping past end of input
This commit is contained in:
commit
090fb07361
2 changed files with 32 additions and 13 deletions
|
@ -657,6 +657,19 @@ fn test_seek_bytes() {
|
|||
.stdout_is("\0\0\0\0\0\0\0\0abcdefghijklm\n");
|
||||
}
|
||||
|
||||
/// Test for skipping beyond the number of bytes in a file.
|
||||
#[test]
|
||||
fn test_skip_beyond_file() {
|
||||
new_ucmd!()
|
||||
.args(&["bs=1", "skip=5", "count=0", "status=noxfer"])
|
||||
.pipe_in("abcd")
|
||||
.succeeds()
|
||||
.no_stdout()
|
||||
.stderr_contains(
|
||||
"'standard input': cannot skip to specified offset\n0+0 records in\n0+0 records out\n",
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_seek_do_not_overwrite() {
|
||||
let (at, mut ucmd) = at_and_ucmd!();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue