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

Function wco_base_patterns

tests/query_test.rs:224–270  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

222
223#[test]
224fn wco_base_patterns() {
225 let data = vec![
226 TxData::add(100, ":name", String("Dipper".to_string())),
227 TxData::add(100, ":name", String("Alias".to_string())),
228 TxData::add(200, ":name", String("Mabel".to_string())),
229 ];
230
231 run_cases(vec![
232 Case {
233 description: "[:find ?e ?n :where [?e :name ?n]]",
234 plan: q(vec![0, 1], vec![Binding::attribute(0, ":name", 1)]),
235 transactions: vec![data.clone()],
236 expectations: vec![vec![
237 (vec![Eid(100), String("Dipper".to_string())], 0, 1),
238 (vec![Eid(100), String("Alias".to_string())], 0, 1),
239 (vec![Eid(200), String("Mabel".to_string())], 0, 1),
240 ]],
241 },
242 Case {
243 description: "[:find ?n :where [100 :name ?n]]",
244 plan: q(
245 vec![0, 1],
246 vec![
247 Binding::attribute(0, ":name", 1),
248 Binding::constant(0, Eid(100)),
249 ],
250 ),
251 transactions: vec![data.clone()],
252 expectations: vec![vec![
253 (vec![Eid(100), String("Alias".to_string())], 0, 1),
254 (vec![Eid(100), String("Dipper".to_string())], 0, 1),
255 ]],
256 },
257 Case {
258 description: "[:find ?e :where [?e :name Mabel]]",
259 plan: q(
260 vec![0, 1],
261 vec![
262 Binding::attribute(0, ":name", 1),
263 Binding::constant(1, String("Mabel".to_string())),
264 ],
265 ),
266 transactions: vec![data.clone()],
267 expectations: vec![vec![(vec![Eid(200), String("Mabel".to_string())], 0, 1)]],
268 },
269 ]);
270}
271
272#[test]
273fn joins() {

Callers

nothing calls this directly

Calls 1

run_casesFunction · 0.70

Tested by

no test coverage detected