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

Function slice_happy

nodedb-sql/src/planner/array_fn/tests.rs:92–111  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

90
91#[test]
92fn slice_happy() {
93 let p =
94 plan_one("SELECT * FROM ARRAY_SLICE('g', '{chrom: [1,1], pos: [0, 100]}', ['qual'], 50)")
95 .unwrap();
96 match p {
97 SqlPlan::ArraySlice {
98 name,
99 slice,
100 attr_projection,
101 limit,
102 ..
103 } => {
104 assert_eq!(name, "g");
105 assert_eq!(slice.dim_ranges.len(), 2);
106 assert_eq!(attr_projection, vec!["qual".to_string()]);
107 assert_eq!(limit, 50);
108 }
109 other => panic!("expected ArraySlice, got {other:?}"),
110 }
111}
112
113#[test]
114fn slice_unknown_dim_rejected() {

Callers

nothing calls this directly

Calls 1

plan_oneFunction · 0.85

Tested by

no test coverage detected