Skip to content

Commit 7ba11d1

Browse files
authored
Tests for iswritable for TCPSocket (#30550)
* Tests for iswritable for TCPSocket
1 parent 2c64220 commit 7ba11d1

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

stdlib/Sockets/test/runtests.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -413,6 +413,17 @@ end
413413
end
414414
end
415415

416+
@testset "iswritable" begin
417+
let addr = Sockets.InetAddr(ip"127.0.0.1", 4445)
418+
srv = listen(addr)
419+
s = Sockets.TCPSocket()
420+
Sockets.connect!(s, addr)
421+
@test iswritable(s)
422+
close(s)
423+
@test !iswritable(s)
424+
end
425+
end
426+
416427
@testset "TCPServer constructor" begin
417428
s = Sockets.TCPServer(; delay=false)
418429
if ccall(:jl_has_so_reuseport, Int32, ()) == 1

0 commit comments

Comments
 (0)