test: multiple messages in single test

This ensures various reused scratch buffers are wiped between uses.
pull/24376/head
Dom Dwyer 2023-07-10 14:03:57 +02:00
parent 71625043e2
commit a686580ffa
No known key found for this signature in database
GPG Key ID: E4C40DBD9157879A
1 changed files with 11 additions and 0 deletions

View File

@ -69,4 +69,15 @@ async fn test_payload_exchange() {
.await
.expect("reactor stopped");
assert_eq!(got, b_payload);
// Send another payload through peer A (ensuring scratch buffers are
// correctly wiped, etc)
let a_payload = Bytes::from_static(b"platanos");
a.broadcast(a_payload.clone()).await.unwrap();
let got = b_rx
.recv()
.with_timeout_panic(TIMEOUT)
.await
.expect("reactor stopped");
assert_eq!(got, a_payload);
}