MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / lag_default_and_offset

Function lag_default_and_offset

nodedb-query/src/window/value_eval.rs:554–563  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

552
553 #[test]
554 fn lag_default_and_offset() {
555 let mut rows = rows_v(&[1, 2, 3]);
556 let cols = ci(&["v"]);
557 let s = spec("lag", vec![col("v")], vec![], vec![(col("v"), true)]);
558 evaluate_window_functions_value(&mut rows, &cols, &[s]).unwrap();
559 // First row has no predecessor → Null; rest carry the prior value.
560 assert!(matches!(rows[0][1], Value::Null));
561 assert_eq!(rows[1][1].as_f64().unwrap() as i64, 1);
562 assert_eq!(rows[2][1].as_f64().unwrap() as i64, 2);
563 }
564
565 #[test]
566 fn lead_boundary() {

Callers

nothing calls this directly

Calls 4

specFunction · 0.85
rows_vFunction · 0.70
ciFunction · 0.70

Tested by

no test coverage detected