Skip to content

Commit

Permalink
Add explicit flush test
Browse files Browse the repository at this point in the history
  • Loading branch information
mmastrac committed Oct 31, 2023
1 parent 547a36b commit 9f84ac4
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -950,6 +950,19 @@ pub(super) mod tests {
Ok(())
}

/// Test that a flush before a handshake completes works.
#[tokio::test]
// #[ntest::timeout(60000)]
async fn test_flush_before_handshake() -> TestResult {
let (mut server, mut client) =
tls_pair().await;
server.write_all(b"hello?").await.unwrap();
server.flush().await.unwrap();
let mut buf = [0; 6];
assert_eq!(6, client.read_exact(&mut buf).await.unwrap());
Ok(())
}

/// Test that the handshake works, and we get the correct ALPN negotiated values.
#[tokio::test]
#[ntest::timeout(60000)]
Expand Down

0 comments on commit 9f84ac4

Please sign in to comment.