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

Function test_hash_file_contents

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

Source from the content-addressed store, hash-verified

1526
1527 #[test]
1528 fn test_hash_file_contents() {
1529 use tempfile::TempDir;
1530
1531 let temp_dir = TempDir::new().unwrap();
1532 let file_path = temp_dir.path().join("test.txt");
1533
1534 std::fs::write(&file_path, b"Hello, world!").unwrap();
1535
1536 let hash = hash_file_contents(&file_path).unwrap();
1537 let expected = Hash::of(b"Hello, world!");
1538
1539 assert_eq!(hash, expected);
1540 }
1541
1542 #[test]
1543 fn test_collect_working_copy_files() {

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected