mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
hashsum: Implement the quiet mode
This commit is contained in:
parent
89b7a1a8fb
commit
6acc8e695f
4 changed files with 48 additions and 5 deletions
|
@ -729,3 +729,31 @@ fn test_check_directory_error() {
|
|||
.fails()
|
||||
.stderr_contains("md5sum: d: Is a directory\n");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_check_quiet() {
|
||||
let scene = TestScenario::new(util_name!());
|
||||
let at = &scene.fixtures;
|
||||
|
||||
at.touch("f");
|
||||
at.write("in.md5", "d41d8cd98f00b204e9800998ecf8427e f\n");
|
||||
scene
|
||||
.ccmd("md5sum")
|
||||
.arg("--quiet")
|
||||
.arg("--check")
|
||||
.arg(at.subdir.join("in.md5"))
|
||||
.succeeds()
|
||||
.stderr_is("")
|
||||
.stdout_is("");
|
||||
|
||||
// incorrect md5
|
||||
at.write("in.md5", "d41d8cd98f00b204e9800998ecf8427f f\n");
|
||||
scene
|
||||
.ccmd("md5sum")
|
||||
.arg("--quiet")
|
||||
.arg("--check")
|
||||
.arg(at.subdir.join("in.md5"))
|
||||
.fails()
|
||||
.stdout_contains("f: FAILED")
|
||||
.stderr_contains("WARNING: 1 computed checksum did NOT match");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue