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

Function chained_arrow_lowers_nested

nodedb-sql/src/resolver/expr/tests.rs:377–394  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

375
376#[test]
377fn chained_arrow_lowers_nested() {
378 // data->'a'->'b' → pg_json_get(pg_json_get(data, 'a'), 'b')
379 let expr = select_expr_lowered("SELECT data->'a'->'b' FROM t");
380 match expr {
381 SqlExpr::Function { name, ref args, .. } => {
382 assert_eq!(name, "pg_json_get", "outer fn should be pg_json_get");
383 match &args[0] {
384 SqlExpr::Function {
385 name: inner_name, ..
386 } => {
387 assert_eq!(inner_name, "pg_json_get", "inner fn should be pg_json_get");
388 }
389 other => panic!("expected inner pg_json_get, got {other:?}"),
390 }
391 }
392 other => panic!("expected outer pg_json_get, got {other:?}"),
393 }
394}
395
396// ── FTS operator / function lowering tests ────────────────────────────────
397

Callers

nothing calls this directly

Calls 1

select_expr_loweredFunction · 0.85

Tested by

no test coverage detected