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

hashsum: warn on file not found rather than fail

This commit is contained in:
David Matos 2022-10-19 20:09:56 +02:00
parent 536dd90ce5
commit d46e5df3d3
2 changed files with 45 additions and 6 deletions

View file

@ -117,6 +117,26 @@ fn test_check_sha1() {
.stderr_is("");
}
#[test]
fn test_check_file_not_found_warning() {
let scene = TestScenario::new(util_name!());
let at = &scene.fixtures;
at.write("testf", "foobar\n");
at.write(
"testf.sha1",
"988881adc9fc3655077dc2d4d757d480b5ea0e11 testf\n",
);
at.remove("testf");
scene
.ccmd("sha1sum")
.arg("-c")
.arg(at.subdir.join("testf.sha1"))
.succeeds()
.stdout_is("sha1sum: testf: No such file or directory\ntestf: FAILED open or read\n")
.stderr_is("sha1sum: warning: 1 listed file could not be read");
}
#[test]
fn test_invalid_arg() {
new_ucmd!().arg("--definitely-invalid").fails().code_is(1);