()
| 181 | |
| 182 | #[test] |
| 183 | fn delete_ratio_and_compaction() { |
| 184 | let mut bm = DeleteBitmap::new(); |
| 185 | for i in 0..30 { |
| 186 | bm.mark_deleted(i); |
| 187 | } |
| 188 | // 30 deleted out of 100 total = 0.3 |
| 189 | assert!((bm.delete_ratio(100) - 0.3).abs() < 0.001); |
| 190 | // Default threshold 0.2 → should compact. |
| 191 | assert!(bm.should_compact(100, 0.2)); |
| 192 | // Threshold 0.5 → should not compact. |
| 193 | assert!(!bm.should_compact(100, 0.5)); |
| 194 | } |
| 195 | |
| 196 | #[test] |
| 197 | fn block_fully_deleted() { |
nothing calls this directly
no test coverage detected