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

Function test_hash_file_contents

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

Source from the content-addressed store, hash-verified

1233
1234 #[test]
1235 fn test_hash_file_contents() {
1236 use tempfile::TempDir;
1237
1238 let temp_dir = TempDir::new().unwrap();
1239 let file_path = temp_dir.path().join("test.txt");
1240
1241 std::fs::write(&file_path, b"Hello, world!").unwrap();
1242
1243 let hash = hash_file_contents(&file_path).unwrap();
1244 let expected = Hash::of(b"Hello, world!");
1245
1246 assert_eq!(hash, expected);
1247 }
1248
1249 #[test]
1250 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