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

Function match_ea_after_input

tests/registration_test.rs:11–73  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9
10#[test]
11fn match_ea_after_input() {
12 timely::execute_directly(move |worker| {
13 let mut server = Server::<u64, u64>::new(Default::default());
14 let (send_results, results) = channel();
15
16 // [:find ?v :where [1 :name ?n]]
17 let plan = Plan::MatchEA(1, ":name".to_string(), 1);
18
19 worker.dataflow::<u64, _, _>(|scope| {
20 let config = AttributeConfig {
21 index_direction: IndexDirection::Both,
22 query_support: QuerySupport::Basic,
23 trace_slack: Some(Time::TxId(1)),
24 ..Default::default()
25 };
26
27 server
28 .context
29 .internal
30 .create_transactable_attribute(":name", config, scope)
31 .unwrap();
32 });
33
34 let tx_data = vec![
35 TxData::add(1, ":name", String("Dipper".to_string())),
36 TxData::add(1, ":name", String("Alias".to_string())),
37 TxData::add(2, ":name", String("Mabel".to_string())),
38 ];
39
40 server.transact(tx_data, 0, 0).unwrap();
41
42 server.advance_domain(None, 1).unwrap();
43
44 worker.step_while(|| server.is_any_outdated());
45
46 worker.dataflow::<u64, _, _>(|scope| {
47 server
48 .test_single(
49 scope,
50 Rule {
51 name: "match_ea".to_string(),
52 plan,
53 },
54 )
55 .inspect(move |x| {
56 send_results.send((x.0.clone(), x.2)).unwrap();
57 });
58 });
59
60 server.advance_domain(None, 2).unwrap();
61
62 worker.step_while(|| server.is_any_outdated());
63
64 assert_eq!(
65 results.recv().unwrap(),
66 (vec![String("Alias".to_string())], 1)
67 );
68 assert_eq!(

Callers

nothing calls this directly

Calls 5

advance_domainMethod · 0.80
is_any_outdatedMethod · 0.80
test_singleMethod · 0.80
transactMethod · 0.45

Tested by

no test coverage detected