MCPcopy Create free account
hub / github.com/comnik/declarative-dataflow / base_patterns

Function base_patterns

tests/query_test.rs:127–161  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

125
126#[test]
127fn base_patterns() {
128 let data = vec![
129 TxData::add(100, ":name", String("Dipper".to_string())),
130 TxData::add(100, ":name", String("Alias".to_string())),
131 TxData::add(200, ":name", String("Mabel".to_string())),
132 ];
133
134 run_cases(vec![
135 Case {
136 description: "[:find ?e ?n :where [?e :name ?n]]",
137 plan: Plan::MatchA(0, ":name".to_string(), 1),
138 transactions: vec![data.clone()],
139 expectations: vec![vec![
140 (vec![Eid(100), String("Dipper".to_string())], 0, 1),
141 (vec![Eid(100), String("Alias".to_string())], 0, 1),
142 (vec![Eid(200), String("Mabel".to_string())], 0, 1),
143 ]],
144 },
145 Case {
146 description: "[:find ?n :where [100 :name ?n]]",
147 plan: Plan::MatchEA(100, ":name".to_string(), 0),
148 transactions: vec![data.clone()],
149 expectations: vec![vec![
150 (vec![String("Alias".to_string())], 0, 1),
151 (vec![String("Dipper".to_string())], 0, 1),
152 ]],
153 },
154 Case {
155 description: "[:find ?e :where [?e :name Mabel]]",
156 plan: Plan::MatchAV(0, ":name".to_string(), String("Mabel".to_string())),
157 transactions: vec![data.clone()],
158 expectations: vec![vec![(vec![Eid(200)], 0, 1)]],
159 },
160 ]);
161}
162
163#[test]
164fn base_projections() {

Callers

nothing calls this directly

Calls 1

run_casesFunction · 0.70

Tested by

no test coverage detected