diff --git a/tests/src/lib.rs b/tests/src/lib.rs index b20bc49bc..72e68535d 100644 --- a/tests/src/lib.rs +++ b/tests/src/lib.rs @@ -180,6 +180,7 @@ where if let Err(error) = roundtrip.encode(&mut buf2) { return RoundtripResult::Error(error.into()); } + let buf3 = roundtrip.encode_to_vec(); /* // Useful for debugging: @@ -192,6 +193,12 @@ where return RoundtripResult::Error(anyhow!("roundtripped encoded buffers do not match")); } + if buf1 != buf3 { + return RoundtripResult::Error(anyhow!( + "roundtripped encoded buffers do not match with `encode_to_vec`" + )); + } + RoundtripResult::Ok(buf1) }