1
Fork 0

Another test: partial frame.

This commit is contained in:
Alex Helfet 2017-12-30 18:10:56 +00:00
parent efc3c65ed7
commit dcd28189b2

View file

@ -593,6 +593,21 @@ mod tests {
}
}
#[test]
#[cfg(feature = "use_std")]
fn decode_to_slice_missing_bytes() {
let encoded = encode_to_box(&PAYLOAD).unwrap();
let encoded = &encoded[1..encoded.len()];
let mut decoded_buf = vec![0u8; max_decoded_len(encoded.len())];
let res = decode_to_slice(&*encoded, &mut decoded_buf);
match res {
Err(Error::ChecksumError) => (),
_ => panic!("Bad output: {:?}", res),
}
}
#[test]
#[cfg(feature = "use_std")]
fn decode_to_box_ok() {