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

Run cargo fmt on the tree

This commit is contained in:
Sylvestre Ledru 2025-03-24 21:04:32 +01:00
parent 36dd968c9a
commit a85539f530
189 changed files with 841 additions and 782 deletions

View file

@ -966,29 +966,41 @@ fn test_cksum_check_failed() {
.arg("CHECKSUM")
.fails();
assert!(result
.stderr_str()
.contains("input: No such file or directory"));
assert!(result
.stderr_str()
.contains("2 lines are improperly formatted\n"));
assert!(result
.stderr_str()
.contains("1 listed file could not be read\n"));
assert!(
result
.stderr_str()
.contains("input: No such file or directory")
);
assert!(
result
.stderr_str()
.contains("2 lines are improperly formatted\n")
);
assert!(
result
.stderr_str()
.contains("1 listed file could not be read\n")
);
assert!(result.stdout_str().contains("f: OK\n"));
// without strict
let result = scene.ucmd().arg("--check").arg("CHECKSUM").fails();
assert!(result
.stderr_str()
.contains("input: No such file or directory"));
assert!(result
.stderr_str()
.contains("2 lines are improperly formatted\n"));
assert!(result
.stderr_str()
.contains("1 listed file could not be read\n"));
assert!(
result
.stderr_str()
.contains("input: No such file or directory")
);
assert!(
result
.stderr_str()
.contains("2 lines are improperly formatted\n")
);
assert!(
result
.stderr_str()
.contains("1 listed file could not be read\n")
);
assert!(result.stdout_str().contains("f: OK\n"));
// tests with two files
@ -1010,15 +1022,21 @@ fn test_cksum_check_failed() {
.fails();
println!("result.stderr_str() {}", result.stderr_str());
println!("result.stdout_str() {}", result.stdout_str());
assert!(result
.stderr_str()
.contains("input2: No such file or directory"));
assert!(result
.stderr_str()
.contains("4 lines are improperly formatted\n"));
assert!(result
.stderr_str()
.contains("2 listed files could not be read\n"));
assert!(
result
.stderr_str()
.contains("input2: No such file or directory")
);
assert!(
result
.stderr_str()
.contains("4 lines are improperly formatted\n")
);
assert!(
result
.stderr_str()
.contains("2 listed files could not be read\n")
);
assert!(result.stdout_str().contains("f: OK\n"));
assert!(result.stdout_str().contains("2: OK\n"));
}
@ -1088,9 +1106,11 @@ fn test_cksum_mixed() {
println!("result.stderr_str() {}", result.stderr_str());
println!("result.stdout_str() {}", result.stdout_str());
assert!(result.stdout_str().contains("f: OK"));
assert!(result
.stderr_str()
.contains("3 lines are improperly formatted"));
assert!(
result
.stderr_str()
.contains("3 lines are improperly formatted")
);
}
#[test]
@ -1221,9 +1241,7 @@ fn test_check_directory_error() {
#[test]
fn test_check_base64_hashes() {
let hashes =
"MD5 (empty) = 1B2M2Y8AsgTpgAmY7PhCfg==\nSHA256 (empty) = 47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=\nBLAKE2b (empty) = eGoC90IBWQPGxv2FJVLScpEvR0DhWEdhiobiF/cfVBnSXhAxr+5YUxOJZESTTrBLkDpoWxRIt1XVb3Aa/pvizg==\n"
;
let hashes = "MD5 (empty) = 1B2M2Y8AsgTpgAmY7PhCfg==\nSHA256 (empty) = 47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=\nBLAKE2b (empty) = eGoC90IBWQPGxv2FJVLScpEvR0DhWEdhiobiF/cfVBnSXhAxr+5YUxOJZESTTrBLkDpoWxRIt1XVb3Aa/pvizg==\n";
let scene = TestScenario::new(util_name!());
let at = &scene.fixtures;
@ -1680,11 +1698,11 @@ mod gnu_cksum_base64 {
),
(
"sha512",
"z4PhNX7vuL3xVChQ1m2AB9Yg5AULVxXcg/SpIdNs6c5H0NE8XYXysP+DGNKHfuwvY7kxvUdBeoGlODJ6+SfaPg=="
"z4PhNX7vuL3xVChQ1m2AB9Yg5AULVxXcg/SpIdNs6c5H0NE8XYXysP+DGNKHfuwvY7kxvUdBeoGlODJ6+SfaPg==",
),
(
"blake2b",
"eGoC90IBWQPGxv2FJVLScpEvR0DhWEdhiobiF/cfVBnSXhAxr+5YUxOJZESTTrBLkDpoWxRIt1XVb3Aa/pvizg=="
"eGoC90IBWQPGxv2FJVLScpEvR0DhWEdhiobiF/cfVBnSXhAxr+5YUxOJZESTTrBLkDpoWxRIt1XVb3Aa/pvizg==",
),
("sm3", "GrIdg1XPoX+OYRlIMegajyK+yMco/vt0ftA161CCqis="),
];