Skip to content

Commit 24b7af5

Browse files
Merge pull request #8 from bravo1goingdark/add-assertion-for-5-byte-frame-in-tests
Enhance timed flush test to verify frame contents
2 parents 19cb11d + 38c07f1 commit 24b7af5

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

tests/timed_flush.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,9 @@ async fn timed_flush_sla_small_frames() {
1616
use tokio::time::{timeout, Duration};
1717
let mut buf = [0u8; 5];
1818
let res = timeout(Duration::from_millis(50), server.read_exact(&mut buf)).await;
19-
assert!(res.is_ok(), "writer did not flush within SLA");
19+
res.expect("writer did not flush within SLA")
20+
.expect("failed to read frame");
21+
22+
let expected = [0x00, 0x00, 0x00, 0x01, 0xCC];
23+
assert_eq!(buf, expected, "unexpected frame contents");
2024
}

0 commit comments

Comments
 (0)