1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

cut: show error for multiple mode args (-b, -c, -f)

This commit is contained in:
wolimst 2024-02-09 15:56:15 +09:00
parent dd64bae278
commit cb0ce0e1cb
2 changed files with 38 additions and 7 deletions

View file

@ -270,3 +270,21 @@ fn test_multiple() {
assert_eq!(result.stdout_str(), "b\n");
assert_eq!(result.stderr_str(), "");
}
#[test]
fn test_multiple_mode_args() {
for args in [
vec!["-b1", "-b2"],
vec!["-c1", "-c2"],
vec!["-f1", "-f2"],
vec!["-b1", "-c2"],
vec!["-b1", "-f2"],
vec!["-c1", "-f2"],
vec!["-b1", "-c2", "-f3"],
] {
new_ucmd!()
.args(&args)
.fails()
.stderr_is("cut: invalid usage: expects no more than one of --fields (-f), --chars (-c) or --bytes (-b)\n");
}
}