()
| 286 | /// `AckVector` records are monotonic: a lower HLC cannot regress the watermark. |
| 287 | #[test] |
| 288 | fn ack_vector_watermark_is_monotonic() { |
| 289 | let mut acks = AckVector::new(); |
| 290 | let h50 = hlc(50, 1); |
| 291 | let h100 = hlc(100, 1); |
| 292 | let h30 = hlc(30, 1); |
| 293 | |
| 294 | acks.record(rep(1), h100); |
| 295 | acks.record(rep(1), h30); // must not regress |
| 296 | acks.record(rep(1), h50); // still below h100 |
| 297 | |
| 298 | assert_eq!( |
| 299 | acks.min_ack_hlc(), |
| 300 | Some(h100), |
| 301 | "watermark must remain at max recorded HLC" |
| 302 | ); |
| 303 | } |