MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / atomic_write_fsync_overwrites

Function atomic_write_fsync_overwrites

nodedb-wal/src/segment/atomic_io.rs:149–157  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

147
148 #[test]
149 fn atomic_write_fsync_overwrites() {
150 let dir = tempfile::tempdir().unwrap();
151 let dst = dir.path().join("payload.ckpt");
152 let tmp = dir.path().join("payload.ckpt.tmp");
153
154 atomic_write_fsync(&tmp, &dst, b"v1").unwrap();
155 atomic_write_fsync(&tmp, &dst, b"v2").unwrap();
156 assert_eq!(fs::read(&dst).unwrap(), b"v2");
157 }
158
159 #[test]
160 fn atomic_swap_dirs_fsync_swaps() {

Callers

nothing calls this directly

Calls 3

atomic_write_fsyncFunction · 0.85
joinMethod · 0.80
pathMethod · 0.45

Tested by

no test coverage detected