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

Function append_then_scan

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

Source from the content-addressed store, hash-verified

160
161 #[test]
162 fn append_then_scan() {
163 let log = InMemoryOpLog::new();
164 log.append(&make_op("arr", 10, 0)).unwrap();
165 log.append(&make_op("arr", 20, 0)).unwrap();
166 assert_eq!(log.len().unwrap(), 2);
167
168 let ops: Vec<_> = log
169 .scan_from(Hlc::ZERO)
170 .unwrap()
171 .map(|r| r.unwrap())
172 .collect();
173 assert_eq!(ops.len(), 2);
174 }
175
176 #[test]
177 fn scan_from_skips_below() {

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected