mirror of
https://github.com/uutils/coreutils
synced 2024-10-15 04:14:44 +00:00
cksum: allow repeated flags and arguments
This commit is contained in:
parent
32b5591736
commit
edb1eb0a76
|
@ -365,6 +365,7 @@ pub fn uu_app() -> Command {
|
|||
.about(ABOUT)
|
||||
.override_usage(format_usage(USAGE))
|
||||
.infer_long_args(true)
|
||||
.args_override_self(true)
|
||||
.arg(
|
||||
Arg::new(options::FILE)
|
||||
.hide(true)
|
||||
|
|
|
@ -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…
Reference in a new issue