1
Fork 0
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:
Daniel Hofstetter 2024-01-15 15:19:10 +01:00 committed by GitHub
commit 112eb21eb3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 54 additions and 8 deletions

View file

@ -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);
}

View file

@ -409,3 +409,11 @@ int main() {
",
);
}
#[test]
fn test_expand_directory() {
new_ucmd!()
.args(&["."])
.fails()
.stderr_contains("expand: .: Is a directory");
}

View file

@ -1258,3 +1258,8 @@ const PRIMES50: &[u64] = &[
1125899906841623,
1125899906841613,
];
#[test]
fn fails_on_directory() {
new_ucmd!().pipe_in(".").fails();
}