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

Function test_hash_file_contents

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

Source from the content-addressed store, hash-verified

1263
1264 #[test]
1265 fn test_hash_file_contents() {
1266 use tempfile::TempDir;
1267
1268 let temp_dir = TempDir::new().unwrap();
1269 let file_path = temp_dir.path().join("test.txt");
1270
1271 std::fs::write(&file_path, b"Hello, world!").unwrap();
1272
1273 let hash = hash_file_contents(&file_path).unwrap();
1274 let expected = Hash::of(b"Hello, world!");
1275
1276 assert_eq!(hash, expected);
1277 }
1278
1279 #[test]
1280 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