mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-09-15 03:26:18 +00:00
Merge pull request #5791 from sylvestre/handle-error
Handle better some errors
This commit is contained in:
commit
112eb21eb3
7 changed files with 54 additions and 8 deletions
|
@ -18,3 +18,16 @@ fn test_z85_not_padded() {
|
|||
.fails()
|
||||
.stderr_only("basenc: error: invalid input (length must be multiple of 4 characters)\n");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_invalid_input() {
|
||||
let error_message = if cfg!(windows) {
|
||||
"basenc: .: Permission denied\n"
|
||||
} else {
|
||||
"basenc: error: invalid input\n"
|
||||
};
|
||||
new_ucmd!()
|
||||
.args(&["--base32", "."])
|
||||
.fails()
|
||||
.stderr_only(error_message);
|
||||
}
|
||||
|
|
|
@ -409,3 +409,11 @@ int main() {
|
|||
",
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_expand_directory() {
|
||||
new_ucmd!()
|
||||
.args(&["."])
|
||||
.fails()
|
||||
.stderr_contains("expand: .: Is a directory");
|
||||
}
|
||||
|
|
|
@ -1258,3 +1258,8 @@ const PRIMES50: &[u64] = &[
|
|||
1125899906841623,
|
||||
1125899906841613,
|
||||
];
|
||||
|
||||
#[test]
|
||||
fn fails_on_directory() {
|
||||
new_ucmd!().pipe_in(".").fails();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue