From d15e78a517f0db1fecf237dd887ff80a013036b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Ludwig?= Date: Wed, 7 Mar 2018 10:59:31 +0100 Subject: [PATCH] Test for proper connection state after a successful accept/connect. Test for #54. --- tests/0-tcp.d | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/0-tcp.d b/tests/0-tcp.d index fa79fdf..75cc479 100644 --- a/tests/0-tcp.d +++ b/tests/0-tcp.d @@ -30,6 +30,7 @@ void main() server.waitForConnections!((incoming_, addr) { incoming = incoming_; // work around ref counting issue + assert(incoming.state == ConnectionState.connected); print("Got incoming, reading data"); incoming.read!((status, bts) { print("Got data"); @@ -67,6 +68,7 @@ void main() connectStream!((sock, status) { client = sock; assert(status == ConnectStatus.connected); + assert(sock.state == ConnectionState.connected); print("Initial write"); client.write!((wstatus, bytes) { print("Initial write done");