From a4f2c32cb778d75a435745d132c0c5e4478b9544 Mon Sep 17 00:00:00 2001 From: Ruben De Smet Date: Mon, 26 Oct 2020 15:40:53 +0100 Subject: [PATCH] test for Message::encode_to_vec --- tests/src/lib.rs | 7 +++++++ 1 file changed, 7 insertions(+) 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) }