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

Function test_codec3

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

Source from the content-addressed store, hash-verified

197
198 #[test]
199 fn test_codec3() {
200 let mut codec = BytesCodec::new();
201 let mut buf = BytesMut::new();
202 let mut bytes: Vec<u8> = Vec::new();
203 bytes.resize(0x3F - 1, 3);
204 assert!(codec.encode(bytes.into(), &mut buf).is_ok());
205 assert_eq!(buf.len(), 0x3F + 1 - 1);
206 if let Ok(Some(res)) = codec.decode(&mut buf) {
207 assert_eq!(res.len(), 0x3F - 1);
208 assert_eq!(res[0], 3);
209 } else {
210 panic!();
211 }
212 }
213 #[test]
214 fn test_codec4() {
215 let mut codec = BytesCodec::new();

Callers

nothing calls this directly

Calls 1

decodeMethod · 0.45

Tested by

no test coverage detected