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

Function roundtrip

nodedb-codec/src/vector_quant/codec_envelope.rs:88–93  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

86
87 #[test]
88 fn roundtrip() {
89 let payload: Vec<i32> = vec![1, -2, 3, -4];
90 let bytes = encode(MAGIC, 7, &payload).unwrap();
91 let restored: Vec<i32> = decode(MAGIC, 7, &bytes).unwrap();
92 assert_eq!(restored, payload);
93 }
94
95 #[test]
96 fn rejects_short_buffer() {

Callers

nothing calls this directly

Calls 2

encodeFunction · 0.70
decodeFunction · 0.70

Tested by

no test coverage detected