MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_hash_file_contents

Function test_hash_file_contents

atomic-repository/src/status.rs:1247–1259  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1245
1246 #[test]
1247 fn test_hash_file_contents() {
1248 use tempfile::TempDir;
1249
1250 let temp_dir = TempDir::new().unwrap();
1251 let file_path = temp_dir.path().join("test.txt");
1252
1253 std::fs::write(&file_path, b"Hello, world!").unwrap();
1254
1255 let hash = hash_file_contents(&file_path).unwrap();
1256 let expected = Hash::of(b"Hello, world!");
1257
1258 assert_eq!(hash, expected);
1259 }
1260
1261 #[test]
1262 fn test_collect_working_copy_files() {

Callers

nothing calls this directly

Calls 4

writeFunction · 0.85
hash_file_contentsFunction · 0.85
unwrapMethod · 0.45
pathMethod · 0.45

Tested by

no test coverage detected