mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
basename: test flag implications, document -z correctly
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
# basename
|
||||
|
||||
```
|
||||
basename NAME [SUFFIX]
|
||||
basename [-z] NAME [SUFFIX]
|
||||
basename OPTION... NAME...
|
||||
```
|
||||
|
||||
|
||||
@@ -201,3 +201,19 @@ fn test_simple_format() {
|
||||
fn test_invalid_arg() {
|
||||
new_ucmd!().arg("--definitely-invalid").fails().code_is(1);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_zero_does_not_imply_multiple() {
|
||||
new_ucmd!()
|
||||
.args(&["-z", "foo.c", "c"])
|
||||
.succeeds()
|
||||
.stdout_is("foo.\0");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_suffix_implies_multiple() {
|
||||
new_ucmd!()
|
||||
.args(&["-s", ".c", "foo.c", "o.c"])
|
||||
.succeeds()
|
||||
.stdout_is("foo\no\n");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user