mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
shuf: accept multiple occurances of head-count argument
This commit is contained in:
parent
c932236826
commit
f6cb42ee2d
2 changed files with 34 additions and 10 deletions
|
@ -196,3 +196,17 @@ fn test_shuf_invalid_input_line_count() {
|
|||
.fails()
|
||||
.stderr_contains("invalid line count: 'a'");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_shuf_multiple_input_line_count() {
|
||||
let result = new_ucmd!()
|
||||
.args(&["-i10-200", "-n", "10", "-n", "5"])
|
||||
.succeeds();
|
||||
result.no_stderr();
|
||||
let result_seq: Vec<&str> = result
|
||||
.stdout_str()
|
||||
.split('\n')
|
||||
.filter(|x| !x.is_empty())
|
||||
.collect();
|
||||
assert_eq!(result_seq.len(), 5, "Output should have 5 items");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue