mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
Add pre-commit hook + run fmt (#1959)
This commit is contained in:
parent
da18ffa496
commit
be03c948ed
4 changed files with 41 additions and 34 deletions
|
@ -38,10 +38,7 @@ fn test_posix_mode() {
|
|||
|
||||
// fail on long path
|
||||
new_ucmd!()
|
||||
.args(&[
|
||||
"-p",
|
||||
&"dir".repeat(libc::PATH_MAX as usize + 1).as_str(),
|
||||
])
|
||||
.args(&["-p", &"dir".repeat(libc::PATH_MAX as usize + 1).as_str()])
|
||||
.fails()
|
||||
.no_stdout();
|
||||
|
||||
|
@ -79,10 +76,7 @@ fn test_posix_special() {
|
|||
|
||||
// fail on long path
|
||||
new_ucmd!()
|
||||
.args(&[
|
||||
"-P",
|
||||
&"dir".repeat(libc::PATH_MAX as usize + 1).as_str(),
|
||||
])
|
||||
.args(&["-P", &"dir".repeat(libc::PATH_MAX as usize + 1).as_str()])
|
||||
.fails()
|
||||
.no_stdout();
|
||||
|
||||
|
@ -107,7 +101,10 @@ fn test_posix_all() {
|
|||
// test the posix special mode
|
||||
|
||||
// accept some reasonable default
|
||||
new_ucmd!().args(&["-p", "-P", "dir/file"]).succeeds().no_stdout();
|
||||
new_ucmd!()
|
||||
.args(&["-p", "-P", "dir/file"])
|
||||
.succeeds()
|
||||
.no_stdout();
|
||||
|
||||
// accept non-leading hyphen
|
||||
new_ucmd!()
|
||||
|
@ -136,10 +133,16 @@ fn test_posix_all() {
|
|||
.no_stdout();
|
||||
|
||||
// fail on non-portable chars
|
||||
new_ucmd!().args(&["-p", "-P", "dir#/$file"]).fails().no_stdout();
|
||||
new_ucmd!()
|
||||
.args(&["-p", "-P", "dir#/$file"])
|
||||
.fails()
|
||||
.no_stdout();
|
||||
|
||||
// fail on leading hyphen char
|
||||
new_ucmd!().args(&["-p", "-P", "dir/-file"]).fails().no_stdout();
|
||||
new_ucmd!()
|
||||
.args(&["-p", "-P", "dir/-file"])
|
||||
.fails()
|
||||
.no_stdout();
|
||||
|
||||
// fail on empty path
|
||||
new_ucmd!().args(&["-p", "-P", ""]).fails().no_stdout();
|
||||
|
@ -149,8 +152,5 @@ fn test_posix_all() {
|
|||
fn test_args_parsing() {
|
||||
// fail on no args
|
||||
let empty_args: [String; 0] = [];
|
||||
new_ucmd!()
|
||||
.args(&empty_args)
|
||||
.fails()
|
||||
.no_stdout();
|
||||
}
|
||||
new_ucmd!().args(&empty_args).fails().no_stdout();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue