mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
Basename arguments simple format (#3736)
* basename: support simple format * tests/basename: add tests for simple format * basename: follow clippy advice
This commit is contained in:
parent
9a1b4b537a
commit
5f3f1112d1
2 changed files with 35 additions and 0 deletions
|
@ -174,3 +174,21 @@ fn test_triple_slash() {
|
|||
let expected = if cfg!(windows) { "\\\n" } else { "/\n" };
|
||||
new_ucmd!().arg("///").succeeds().stdout_is(expected);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_simple_format() {
|
||||
new_ucmd!().args(&["a-a", "-a"]).succeeds().stdout_is("a\n");
|
||||
new_ucmd!()
|
||||
.args(&["a--help", "--help"])
|
||||
.succeeds()
|
||||
.stdout_is("a\n");
|
||||
new_ucmd!().args(&["a-h", "-h"]).succeeds().stdout_is("a\n");
|
||||
new_ucmd!().args(&["f.s", ".s"]).succeeds().stdout_is("f\n");
|
||||
new_ucmd!().args(&["a-s", "-s"]).succeeds().stdout_is("a\n");
|
||||
new_ucmd!().args(&["a-z", "-z"]).succeeds().stdout_is("a\n");
|
||||
new_ucmd!()
|
||||
.args(&["a", "b", "c"])
|
||||
.fails()
|
||||
.code_is(1)
|
||||
.stderr_contains("extra operand 'c'");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue