()
| 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() { |
nothing calls this directly
no test coverage detected