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

Function test_advance_only_source

tests/domain_test.rs:65–211  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

63
64#[test]
65fn test_advance_only_source() {
66 timely::execute_directly(move |worker| {
67 let mut domain = Domain::<u64>::new(0);
68
69 let (_handle, mut cap) = worker.dataflow::<u64, _, _>(|scope| {
70 let ((handle, cap), pairs) =
71 scope.new_unordered_input::<((Value, Value), u64, isize)>();
72
73 domain
74 .create_sourced_attribute(
75 "source_test",
76 AttributeConfig::tx_time(InputSemantics::Raw),
77 &pairs,
78 )
79 .unwrap();
80
81 domain
82 .create_transactable_attribute(
83 "tx_test",
84 AttributeConfig::tx_time(InputSemantics::Raw),
85 scope,
86 )
87 .unwrap();
88
89 (handle, cap)
90 });
91
92 assert_eq!(domain.probed_source_count(), 1);
93 assert_eq!(domain.epoch(), &0);
94 assert!(!domain.dominates(AntichainRef::new(&[])));
95 assert!(!domain.dominates(AntichainRef::new(&[0])));
96 assert_eq!(
97 domain
98 .forward_propose
99 .get_mut("tx_test")
100 .unwrap()
101 .advance_frontier(),
102 &[0]
103 );
104 assert_eq!(
105 domain
106 .forward_propose
107 .get_mut("tx_test")
108 .unwrap()
109 .distinguish_frontier(),
110 &[0]
111 );
112 assert_eq!(
113 domain
114 .forward_propose
115 .get_mut("source_test")
116 .unwrap()
117 .advance_frontier(),
118 &[0]
119 );
120 assert_eq!(
121 domain
122 .forward_propose

Callers

nothing calls this directly

Calls 4

dominatesMethod · 0.80
advanceMethod · 0.80

Tested by

no test coverage detected