()
| 15 | |
| 16 | #[test] |
| 17 | fn stream_buffer_push_and_read() { |
| 18 | let buf = StreamBuffer::new("orders_stream".to_string(), RetentionConfig::default()); |
| 19 | buf.push(make_cdc_event(1, 0, "orders", "INSERT")); |
| 20 | buf.push(make_cdc_event(2, 0, "orders", "UPDATE")); |
| 21 | buf.push(make_cdc_event(3, 1, "orders", "INSERT")); |
| 22 | |
| 23 | let all = buf.read_from_lsn(0, 100); |
| 24 | assert_eq!(all.len(), 3); |
| 25 | |
| 26 | let p0 = buf.read_partition_from_lsn(0, 0, 100); |
| 27 | assert_eq!(p0.len(), 2); |
| 28 | |
| 29 | let p1 = buf.read_partition_from_lsn(1, 0, 100); |
| 30 | assert_eq!(p1.len(), 1); |
| 31 | } |
| 32 | |
| 33 | #[test] |
| 34 | fn stream_buffer_retention_evicts_oldest() { |
nothing calls this directly
no test coverage detected