Skip to content

Commit

Permalink
test for Message::encode_to_vec
Browse files Browse the repository at this point in the history
  • Loading branch information
rubdos committed Jan 29, 2021
1 parent f565986 commit a4f2c32
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/src/lib.rs
Expand Up @@ -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:
Expand All @@ -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)
}

Expand Down

0 comments on commit a4f2c32

Please sign in to comment.