()
| 138 | |
| 139 | #[test] |
| 140 | fn mem_storage_compact() { |
| 141 | let mut s = MemStorage::new(); |
| 142 | for i in 1..=10 { |
| 143 | s.append(&[LogEntry { |
| 144 | term: 1, |
| 145 | index: i, |
| 146 | data: vec![], |
| 147 | }]) |
| 148 | .unwrap(); |
| 149 | } |
| 150 | s.compact(5, 1).unwrap(); |
| 151 | assert_eq!(s.snapshot_metadata(), (5, 1)); |
| 152 | let loaded = s.load_entries_after(5).unwrap(); |
| 153 | assert_eq!(loaded.len(), 5); |
| 154 | assert_eq!(loaded[0].index, 6); |
| 155 | } |
| 156 | |
| 157 | #[test] |
| 158 | fn mem_storage_hard_state() { |
nothing calls this directly
no test coverage detected