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]