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

Function framing_round_trip

nodedb-array/src/segment/format/framing.rs:75–83  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

73
74 #[test]
75 fn framing_round_trip() {
76 let payload = b"hello world";
77 let mut buf = Vec::new();
78 let n = BlockFraming::encode(payload, &mut buf);
79 assert_eq!(n, FRAMING_OVERHEAD + payload.len());
80 let (got, total) = BlockFraming::decode(&buf).unwrap();
81 assert_eq!(got, payload);
82 assert_eq!(total, n);
83 }
84
85 #[test]
86 fn framing_round_trip_empty() {

Callers

nothing calls this directly

Calls 2

encodeFunction · 0.50
decodeFunction · 0.50

Tested by

no test coverage detected