Skip to content

Commit

Permalink
Add back closing fd test to connect test
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomasdezeeuw committed Jun 14, 2024
1 parent 80a97ac commit f629b82
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/async_fd/net.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit f629b82

Please sign in to comment.