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

Function block_roundtrip

nodedb-fts/src/block.rs:285–297  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

283
284 #[test]
285 fn block_roundtrip() {
286 let postings = make_postings(50);
287 let block = PostingBlock::from_postings(&postings);
288 assert_eq!(block.len(), 50);
289
290 let bytes = block.to_bytes();
291 let restored = PostingBlock::from_bytes(&bytes).unwrap();
292
293 assert_eq!(restored.doc_ids, block.doc_ids);
294 assert_eq!(restored.term_freqs, block.term_freqs);
295 assert_eq!(restored.fieldnorms, block.fieldnorms);
296 assert_eq!(restored.positions, block.positions);
297 }
298
299 #[test]
300 fn block_128_roundtrip() {

Callers

nothing calls this directly

Calls 2

make_postingsFunction · 0.70
to_bytesMethod · 0.45

Tested by

no test coverage detected