1
Fork 0
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:
DevSabb 2022-03-28 10:17:07 -04:00
parent c932236826
commit f6cb42ee2d
2 changed files with 34 additions and 10 deletions

View file

@ -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");
}