1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 03:27:44 +00:00

Merge pull request #7918 from Qelxiros/7906-hashsum-errors

hashsum: don't exit early on io errors
This commit is contained in:
Dorian Péron 2025-06-14 21:17:30 +02:00 committed by GitHub
commit e2eb601948
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 44 additions and 8 deletions

View file

@ -98,6 +98,27 @@ macro_rules! test_digest {
.no_stderr()
.stdout_is(std::str::from_utf8(&expected).unwrap());
}
#[test]
fn test_missing_file() {
let ts = TestScenario::new("hashsum");
let at = &ts.fixtures;
at.write("a", "file1\n");
at.write("c", "file3\n");
#[cfg(unix)]
let file_not_found_str = "No such file or directory";
#[cfg(not(unix))]
let file_not_found_str = "The system cannot find the file specified";
ts.ucmd()
.args(&[DIGEST_ARG, BITS_ARG, "a", "b", "c"])
.fails()
.stdout_contains("a\n")
.stdout_contains("c\n")
.stderr_contains(format!("b: {file_not_found_str}"));
}
}
)*)
}