MCPcopy Create free account
hub / github.com/Recordscript/recordscript / test_codec4

Function test_codec4

libs/hbb_common/src/bytes_codec.rs:214–227  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

212 }
213 #[test]
214 fn test_codec4() {
215 let mut codec = BytesCodec::new();
216 let mut buf = BytesMut::new();
217 let mut bytes: Vec<u8> = Vec::new();
218 bytes.resize(0x3FFF, 4);
219 assert!(codec.encode(bytes.into(), &mut buf).is_ok());
220 assert_eq!(buf.len(), 0x3FFF + 2);
221 if let Ok(Some(res)) = codec.decode(&mut buf) {
222 assert_eq!(res.len(), 0x3FFF);
223 assert_eq!(res[0], 4);
224 } else {
225 panic!();
226 }
227 }
228
229 #[test]
230 fn test_codec5() {

Callers

nothing calls this directly

Calls 1

decodeMethod · 0.45

Tested by

no test coverage detected