Skip to content

Commit

Permalink
add Socket.isOpen unittest
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinNowak committed May 11, 2018
1 parent 6ab0db1 commit 7896e23
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/std/io/net/socket.d
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,17 @@ struct Socket
return s != Driver.INVALID_SOCKET;
}

///
unittest
{
Socket s;
assert(!s.isOpen);
s = Socket(ProtocolFamily.IPv4, SocketType.dgram);
assert(s.isOpen);
s.close;
assert(!s.isOpen);
}

/**
Bind socket to `addr`.
Expand Down

0 comments on commit 7896e23

Please sign in to comment.