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

Function roundtrip_bytes

nodedb/src/storage/segment.rs:337–342  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

335
336 #[test]
337 fn roundtrip_bytes() {
338 let footer = SegmentFooter::new("node-1", 0xDEADBEEF, Lsn::new(10), Lsn::new(99));
339 let bytes = footer.to_bytes();
340 let parsed = SegmentFooter::from_bytes(&bytes).unwrap();
341 assert_eq!(footer, parsed);
342 }
343
344 #[test]
345 fn invalid_magic_rejected() {

Callers

nothing calls this directly

Calls 1

to_bytesMethod · 0.45

Tested by

no test coverage detected