MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / scan_from_skips_below

Function scan_from_skips_below

nodedb-array/src/sync/op_log.rs:177–191  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

175
176 #[test]
177 fn scan_from_skips_below() {
178 let log = InMemoryOpLog::new();
179 for ms in [10, 20, 30, 40] {
180 log.append(&make_op("arr", ms, 0)).unwrap();
181 }
182
183 let ops: Vec<_> = log
184 .scan_from(hlc(25, 0))
185 .unwrap()
186 .map(|r| r.unwrap())
187 .collect();
188 // Only ms=30 and ms=40 should appear.
189 assert_eq!(ops.len(), 2);
190 assert!(ops.iter().all(|op| op.header.hlc.physical_ms >= 25));
191 }
192
193 #[test]
194 fn drop_below_drops_correctly() {

Callers

nothing calls this directly

Calls 5

collectMethod · 0.80
make_opFunction · 0.70
hlcFunction · 0.70
appendMethod · 0.45
scan_fromMethod · 0.45

Tested by

no test coverage detected