mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
hashsum: handle the case when md5sum is used but the file contains a different algo
This commit is contained in:
parent
0882eea07c
commit
89b7a1a8fb
3 changed files with 37 additions and 4 deletions
|
@ -668,6 +668,22 @@ fn test_check_status_code() {
|
|||
.stdout_is("");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_sha1_with_md5sum_should_fail() {
|
||||
let scene = TestScenario::new(util_name!());
|
||||
let at = &scene.fixtures;
|
||||
|
||||
at.touch("f");
|
||||
at.write("f.sha1", "SHA1 (f) = d41d8cd98f00b204e9800998ecf8427e\n");
|
||||
scene
|
||||
.ccmd("md5sum")
|
||||
.arg("--check")
|
||||
.arg(at.subdir.join("f.sha1"))
|
||||
.fails()
|
||||
.stderr_contains("f.sha1: no properly formatted checksum lines found")
|
||||
.stderr_does_not_contain("WARNING: 1 line is improperly formatted");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_check_no_backslash_no_space() {
|
||||
let scene = TestScenario::new(util_name!());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue