mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
cksum: allow repeated flags and arguments
This commit is contained in:
parent
32b5591736
commit
edb1eb0a76
2 changed files with 27 additions and 0 deletions
|
@ -128,6 +128,18 @@ fn test_stdin_larger_than_128_bytes() {
|
|||
assert_eq!(bytes_cnt, 2058);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_repeated_flags() {
|
||||
new_ucmd!()
|
||||
.arg("-a")
|
||||
.arg("sha1")
|
||||
.arg("--algo=sha256")
|
||||
.arg("-a=md5")
|
||||
.arg("lorem_ipsum.txt")
|
||||
.succeeds()
|
||||
.stdout_is_fixture("md5_single_file.expected");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_algorithm_single_file() {
|
||||
for algo in ALGOS {
|
||||
|
@ -291,6 +303,20 @@ fn test_length_is_zero() {
|
|||
.stdout_is_fixture("length_is_zero.expected");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_length_repeated() {
|
||||
new_ucmd!()
|
||||
.arg("--length=10")
|
||||
.arg("--length=123456")
|
||||
.arg("--length=0")
|
||||
.arg("--algorithm=blake2b")
|
||||
.arg("lorem_ipsum.txt")
|
||||
.arg("alice_in_wonderland.txt")
|
||||
.succeeds()
|
||||
.no_stderr()
|
||||
.stdout_is_fixture("length_is_zero.expected");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_raw_single_file() {
|
||||
for algo in ALGOS {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue