()
| 472 | |
| 473 | #[test] |
| 474 | fn replay_from_checkpoint_lsn() { |
| 475 | let dir = tempfile::tempdir().unwrap(); |
| 476 | let wal_dir = dir.path().join("wal"); |
| 477 | |
| 478 | let mut wal = SegmentedWal::open(test_config(&wal_dir)).unwrap(); |
| 479 | for i in 0..10u32 { |
| 480 | wal.append(RecordType::Put as u32, 1, 0, 0, format!("r{i}").as_bytes()) |
| 481 | .unwrap(); |
| 482 | } |
| 483 | wal.sync().unwrap(); |
| 484 | |
| 485 | // Replay from LSN 6 — should return LSNs 6..=10. |
| 486 | let records = wal.replay_from(6).unwrap(); |
| 487 | assert_eq!(records.len(), 5); |
| 488 | assert_eq!(records[0].header.lsn, 6); |
| 489 | assert_eq!(records[4].header.lsn, 10); |
| 490 | } |
| 491 | |
| 492 | #[test] |
| 493 | fn total_size_bytes() { |
nothing calls this directly
no test coverage detected