()
| 307 | |
| 308 | #[test] |
| 309 | fn evicts_at_capacity() { |
| 310 | let buf = StreamBuffer::new( |
| 311 | "test".into(), |
| 312 | RetentionConfig { |
| 313 | max_events: 3, |
| 314 | max_age_secs: 3600, |
| 315 | }, |
| 316 | ); |
| 317 | |
| 318 | for i in 1..=5 { |
| 319 | buf.push(make_event(i, i * 10)); |
| 320 | } |
| 321 | |
| 322 | assert_eq!(buf.len(), 3); |
| 323 | assert_eq!(buf.earliest_lsn(), Some(30)); |
| 324 | assert_eq!(buf.total_evicted(), 2); |
| 325 | } |
| 326 | |
| 327 | #[test] |
| 328 | fn read_from_lsn_with_limit() { |
nothing calls this directly
no test coverage detected