1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-09-15 03:26:18 +00:00

Merge pull request #6011 from BenWiederhake/dev-shuf-repeat-zero-items

shuf: Refuse repeating zero lines
This commit is contained in:
Daniel Hofstetter 2024-02-27 15:28:06 +01:00 committed by GitHub
commit aa0d15d1ac
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 32 additions and 4 deletions

View file

@ -624,3 +624,32 @@ fn test_shuf_multiple_input_line_count() {
.count();
assert_eq!(result_count, 5, "Output should have 5 items");
}
#[test]
#[ignore = "known issue"]
fn test_shuf_repeat_empty_range() {
new_ucmd!()
.arg("-ri4-3")
.fails()
.no_stdout()
.stderr_only("shuf: no lines to repeat\n");
}
#[test]
fn test_shuf_repeat_empty_echo() {
new_ucmd!()
.arg("-re")
.fails()
.no_stdout()
.stderr_only("shuf: no lines to repeat\n");
}
#[test]
fn test_shuf_repeat_empty_input() {
new_ucmd!()
.arg("-r")
.pipe_in("")
.fails()
.no_stdout()
.stderr_only("shuf: no lines to repeat\n");
}