mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
dd: custom positional argument parsing
This commit is contained in:
parent
7b4dcc3748
commit
e377e4f046
7 changed files with 1012 additions and 1636 deletions
|
@ -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");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue