From f629b828aa6bc4041006ec3c41963a5ce6d4c3de Mon Sep 17 00:00:00 2001 From: Thomas de Zeeuw Date: Fri, 14 Jun 2024 09:02:25 +0200 Subject: [PATCH] Add back closing fd test to connect test --- tests/async_fd/net.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/async_fd/net.rs b/tests/async_fd/net.rs index 3edba3c..de4e572 100644 --- a/tests/async_fd/net.rs +++ b/tests/async_fd/net.rs @@ -381,8 +381,13 @@ fn connect() { client.write_all(DATA2).expect("failed to write"); buf.clear(); buf.reserve(DATA2.len() + 1); - let buf = waker.block_on(stream.read(buf)).expect("failed to read"); + let mut buf = waker.block_on(stream.read(buf)).expect("failed to read"); assert_eq!(buf, DATA2); + + // Dropping the stream should close it. + drop(stream); + let n = client.read(&mut buf).expect("failed to read"); + assert_eq!(n, 0); } #[test]