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

Function test_write_file_overwrites

atomic-core/src/output/memory.rs:1076–1087  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1074
1075 #[test]
1076 fn test_write_file_overwrites() {
1077 let wc = Memory::new();
1078 wc.add_file("test.txt", b"old content");
1079
1080 let inode = wc.allocate_inode();
1081 {
1082 let mut writer = wc.write_file("test.txt", inode).unwrap();
1083 writer.write_all(b"new content").unwrap();
1084 }
1085
1086 assert_eq!(wc.get_file_contents("test.txt").unwrap(), b"new content");
1087 }
1088
1089 // -------------------------------------------------------------------------
1090 // MemoryError Tests

Callers

nothing calls this directly

Calls 4

allocate_inodeMethod · 0.80
add_fileMethod · 0.45
unwrapMethod · 0.45
write_fileMethod · 0.45

Tested by

no test coverage detected