mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 19:47:45 +00:00
shuf: include all echo args, not just the last
This commit is contained in:
parent
420dfe8a9b
commit
07e8f4c7a5
2 changed files with 22 additions and 0 deletions
|
@ -129,6 +129,7 @@ pub fn uu_app() -> Command {
|
||||||
.help("treat each ARG as an input line")
|
.help("treat each ARG as an input line")
|
||||||
.use_value_delimiter(false)
|
.use_value_delimiter(false)
|
||||||
.num_args(0..)
|
.num_args(0..)
|
||||||
|
.action(clap::ArgAction::Append)
|
||||||
.conflicts_with(options::INPUT_RANGE),
|
.conflicts_with(options::INPUT_RANGE),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
|
|
|
@ -79,6 +79,27 @@ fn test_echo() {
|
||||||
assert_eq!(result_seq, input_seq, "Output is not a permutation");
|
assert_eq!(result_seq, input_seq, "Output is not a permutation");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_echo_multi() {
|
||||||
|
let result = new_ucmd!()
|
||||||
|
.arg("-e")
|
||||||
|
.arg("a")
|
||||||
|
.arg("b")
|
||||||
|
.arg("-e")
|
||||||
|
.arg("c")
|
||||||
|
.succeeds();
|
||||||
|
result.no_stderr();
|
||||||
|
|
||||||
|
let mut result_seq: Vec<String> = result
|
||||||
|
.stdout_str()
|
||||||
|
.split('\n')
|
||||||
|
.filter(|x| !x.is_empty())
|
||||||
|
.map(|x| x.into())
|
||||||
|
.collect();
|
||||||
|
result_seq.sort_unstable();
|
||||||
|
assert_eq!(result_seq, ["a", "b", "c"], "Output is not a permutation");
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_head_count() {
|
fn test_head_count() {
|
||||||
let repeat_limit = 5;
|
let repeat_limit = 5;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue