1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-09-15 19:36:16 +00:00

Merge pull request #3938 from tertsdiepraam/dd-positional-args

`dd`: parse operands manually via positional args
This commit is contained in:
Sylvestre Ledru 2022-09-21 22:39:13 +02:00 committed by GitHub
commit 5a746a778f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 1012 additions and 1636 deletions

View file

@ -1165,12 +1165,12 @@ fn test_bytes_iseek_bytes_iflag() {
}
#[test]
fn test_bytes_iseek_skip_additive() {
fn test_bytes_iseek_skip_not_additive() {
new_ucmd!()
.args(&["iseek=5", "skip=5", "iflag=skip_bytes", "bs=2"])
.args(&["iseek=4", "skip=4", "iflag=skip_bytes", "bs=2"])
.pipe_in("0123456789abcdefghijklm")
.succeeds()
.stdout_is("abcdefghijklm");
.stdout_is("456789abcdefghijklm");
}
#[test]
@ -1193,9 +1193,9 @@ fn test_bytes_oseek_bytes_trunc_oflag() {
}
#[test]
fn test_bytes_oseek_seek_additive() {
fn test_bytes_oseek_seek_not_additive() {
new_ucmd!()
.args(&["oseek=4", "seek=4", "oflag=seek_bytes", "bs=2"])
.args(&["oseek=8", "seek=8", "oflag=seek_bytes", "bs=2"])
.pipe_in("abcdefghijklm")
.succeeds()
.stdout_is_fixture_bytes("dd-bytes-alphabet-null.spec");
@ -1278,3 +1278,20 @@ fn test_invalid_file_arg_gnu_compatibility() {
.pipe_in("")
.succeeds();
}
#[test]
fn test_ucase_lcase() {
new_ucmd!()
.arg("conv=ucase,lcase")
.fails()
.stderr_contains("lcase")
.stderr_contains("ucase");
}
#[test]
fn test_big_multiplication() {
new_ucmd!()
.arg("ibs=10x10x10x10x10x10x10x10x10x10x10x10x10x10x10x10x10x10x10x10x10x10x10")
.fails()
.stderr_contains("invalid number");
}

View file

@ -90,16 +90,16 @@ fn test_ls_allocation_size() {
// fill empty file with zeros
scene
.ccmd("dd")
.arg("--if=/dev/zero")
.arg("--of=some-dir1/zero-file")
.arg("if=/dev/zero")
.arg("of=some-dir1/zero-file")
.arg("bs=1024")
.arg("count=4096")
.succeeds();
scene
.ccmd("dd")
.arg("--if=/dev/zero")
.arg("--of=irregular-file")
.arg("if=/dev/zero")
.arg("of=irregular-file")
.arg("bs=1")
.arg("count=777")
.succeeds();