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

Function atomic_write_fsync_roundtrip

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

Source from the content-addressed store, hash-verified

136
137 #[test]
138 fn atomic_write_fsync_roundtrip() {
139 let dir = tempfile::tempdir().unwrap();
140 let dst = dir.path().join("payload.ckpt");
141 let tmp = dir.path().join("payload.ckpt.tmp");
142
143 atomic_write_fsync(&tmp, &dst, b"hello world").unwrap();
144 assert!(!tmp.exists(), "tmp must be renamed away");
145 assert_eq!(fs::read(&dst).unwrap(), b"hello world");
146 }
147
148 #[test]
149 fn atomic_write_fsync_overwrites() {

Callers

nothing calls this directly

Calls 3

atomic_write_fsyncFunction · 0.85
joinMethod · 0.80
pathMethod · 0.45

Tested by

no test coverage detected