()
| 96 | |
| 97 | #[test] |
| 98 | fn recover_empty_wal() { |
| 99 | let dir = tempfile::tempdir().unwrap(); |
| 100 | let path = dir.path().join("empty.wal"); |
| 101 | |
| 102 | // Create empty WAL. |
| 103 | { |
| 104 | let mut writer = WalWriter::open_without_direct_io(&path).unwrap(); |
| 105 | writer.sync().unwrap(); |
| 106 | } |
| 107 | |
| 108 | let info = recover(&path).unwrap(); |
| 109 | assert_eq!(info.last_lsn, 0); |
| 110 | assert_eq!(info.record_count, 0); |
| 111 | assert_eq!(info.next_lsn(), 1); |
| 112 | } |
| 113 | |
| 114 | #[test] |
| 115 | fn recover_nonexistent_file() { |