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

Function payload_msgpack_roundtrip

nodedb-array/src/tile/cell_payload.rs:86–94  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

84
85 #[test]
86 fn payload_msgpack_roundtrip() {
87 let p = sample_payload();
88 let bytes = p.encode().unwrap();
89 let decoded = CellPayload::decode(&bytes).unwrap();
90 assert_eq!(decoded.valid_from_ms, 1_000);
91 assert_eq!(decoded.valid_until_ms, OPEN_UPPER);
92 assert_eq!(decoded.attrs, vec![CellValue::Int64(42)]);
93 assert_eq!(decoded.surrogate, Surrogate::ZERO);
94 }
95
96 #[test]
97 fn encoded_payload_first_byte_is_fixarray() {

Callers

nothing calls this directly

Calls 3

sample_payloadFunction · 0.85
decodeFunction · 0.50
encodeMethod · 0.45

Tested by

no test coverage detected