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

Function framing_round_trip_empty

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

Source from the content-addressed store, hash-verified

84
85 #[test]
86 fn framing_round_trip_empty() {
87 let mut buf = Vec::new();
88 BlockFraming::encode(&[], &mut buf);
89 let (got, total) = BlockFraming::decode(&buf).unwrap();
90 assert_eq!(got, &[] as &[u8]);
91 assert_eq!(total, FRAMING_OVERHEAD);
92 }
93
94 #[test]
95 fn framing_rejects_truncated_header() {

Callers

nothing calls this directly

Calls 2

encodeFunction · 0.50
decodeFunction · 0.50

Tested by

no test coverage detected