Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests for iswritable for TCPSocket #30550

Merged
merged 3 commits into from
Jan 2, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions stdlib/Sockets/test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,18 @@ end
end
end

@testset "iswritable" begin
let addr = Sockets.InetAddr(ip"127.0.0.1", 4445)
srv = listen(addr)
s = Sockets.TCPSocket()
Sockets.connect!(s, addr)
@test iswritable(s)
r = @async close(s)
kshyatt marked this conversation as resolved.
Show resolved Hide resolved
fetch(r)
kshyatt marked this conversation as resolved.
Show resolved Hide resolved
@test !iswritable(s)
end
end

@testset "TCPServer constructor" begin
s = Sockets.TCPServer(; delay=false)
if ccall(:jl_has_so_reuseport, Int32, ()) == 1
Expand Down