| 571 | |
| 572 | #[test] |
| 573 | fn rows_bounds_resolution() { |
| 574 | let order = vec![]; |
| 575 | let groups = vec![]; |
| 576 | let f = frame("rows", FrameBound::Preceding(1), FrameBound::Following(1)); |
| 577 | // Middle of a 5-row partition → window [pos-1, pos+1]. |
| 578 | assert_eq!(evaluate_v_frame_bounds(&f, 2, 5, &order, &groups), (1, 3)); |
| 579 | // First row clamps the preceding bound to 0. |
| 580 | assert_eq!(evaluate_v_frame_bounds(&f, 0, 5, &order, &groups), (0, 1)); |
| 581 | // Last row clamps the following bound to len-1. |
| 582 | assert_eq!(evaluate_v_frame_bounds(&f, 4, 5, &order, &groups), (3, 4)); |
| 583 | } |
| 584 | |
| 585 | #[test] |
| 586 | fn range_bounds_expand_over_peers() { |