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

Function run_transform_cases

tests/transform_test.rs:36–154  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

34
35#[test]
36fn run_transform_cases() {
37 let mut cases = vec![Case {
38 description: "[:find ?h :where [?e :timestamp ?t] [(interval ?t) ?h]]",
39 plan: {
40 let (e, t, h) = (1, 2, 3);
41 let constants = vec![None, None];
42 // let constants = vec![None, Some(Value::String(String::from("hour")))];
43 Plan::Transform(Transform {
44 variables: vec![t],
45 result_variable: h,
46 plan: Box::new(Plan::MatchA(e, ":timestamp".to_string(), t)),
47 function: Function::TRUNCATE,
48 constants,
49 })
50 },
51 transactions: vec![vec![
52 TxData::add(1, ":timestamp", Instant(1_540_048_515_500)),
53 TxData::add(2, ":timestamp", Instant(1_540_048_515_616)),
54 ]],
55 expectations: vec![vec![
56 (
57 vec![
58 Eid(1),
59 Instant(1_540_048_515_500),
60 Instant(1_540_047_600_000),
61 ],
62 0,
63 1,
64 ),
65 (
66 vec![
67 Eid(2),
68 Instant(1_540_048_515_616),
69 Instant(1_540_047_600_000),
70 ],
71 0,
72 1,
73 ),
74 ]],
75 }];
76
77 for case in cases.drain(..) {
78 timely::execute_directly(move |worker| {
79 let mut server = Server::<u64, u64>::new(Default::default());
80 let (send_results, results) = channel();
81
82 dbg!(case.description);
83
84 let deps = dependencies(&case);
85 let plan = case.plan.clone();
86
87 worker.dataflow::<u64, _, _>(|scope| {
88 for dep in deps.iter() {
89 server
90 .context
91 .internal
92 .create_transactable_attribute(
93 dep,

Callers

nothing calls this directly

Calls 7

test_singleMethod · 0.80
advance_domainMethod · 0.80
is_any_outdatedMethod · 0.80
dependenciesFunction · 0.70
sinkMethod · 0.45
transactMethod · 0.45

Tested by

no test coverage detected