+
+ #[test]
+ fn test_invalid_shasums() {
+ let no_format = "4b91f7a387a6edd4a7c0afb2897f1ca968c9695b cp";
+ let invalid_format = "4b91f7a387a6edd4a7c0afb2897f1ca968c9695b .cp";
+ let extra_space = "4b91f7a387a6edd4a7c0afb2897f1ca968c9695b cp";
+
+ for digest in [no_format, invalid_format, extra_space] {
+ let lines = digest.lines().map(|l| std::io::Result::Ok(l));
+ assert!(
+ read_coreutils_digests_from_file(lines, &PathBuf::from("SHASUMS")).is_none(),
+ "Should be invalid digest: {:?}",
+ digest
+ );
+ }
+ }