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

Function test_codec5

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

Source from the content-addressed store, hash-verified

228
229 #[test]
230 fn test_codec5() {
231 let mut codec = BytesCodec::new();
232 let mut buf = BytesMut::new();
233 let mut bytes: Vec<u8> = Vec::new();
234 bytes.resize(0x3FFFFF, 5);
235 assert!(codec.encode(bytes.into(), &mut buf).is_ok());
236 assert_eq!(buf.len(), 0x3FFFFF + 3);
237 if let Ok(Some(res)) = codec.decode(&mut buf) {
238 assert_eq!(res.len(), 0x3FFFFF);
239 assert_eq!(res[0], 5);
240 } else {
241 panic!();
242 }
243 }
244
245 #[test]
246 fn test_codec6() {

Callers

nothing calls this directly

Calls 1

decodeMethod · 0.45

Tested by

no test coverage detected