()
| 284 | |
| 285 | #[test] |
| 286 | fn should_compact_threshold() { |
| 287 | let mut engine = MutationEngine::new("test".into(), test_schema()); |
| 288 | |
| 289 | // Insert and flush to create a real segment. |
| 290 | for i in 0..10 { |
| 291 | engine |
| 292 | .insert(&[ |
| 293 | Value::Integer(i), |
| 294 | Value::String(format!("u{i}")), |
| 295 | Value::Null, |
| 296 | ]) |
| 297 | .expect("insert"); |
| 298 | } |
| 299 | engine.on_memtable_flushed(1).expect("flush"); |
| 300 | |
| 301 | // Delete 3 out of 10 rows = 30% > 20% threshold. |
| 302 | for i in 0..3 { |
| 303 | engine.delete(&Value::Integer(i)).expect("delete"); |
| 304 | } |
| 305 | |
| 306 | assert!(engine.should_compact(1, 10)); |
| 307 | } |
| 308 | |
| 309 | #[test] |
| 310 | fn segment_id_allocator_returns_err_at_u64_max() { |
nothing calls this directly
no test coverage detected