Skip to content

Commit 86e37a9

Browse files
nobuk0kubun
authored andcommitted
Test for the crash
1 parent 7e093fb commit 86e37a9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

test/socket/test_tcp.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ def test_inspect
1818
end
1919

2020
def test_initialize_failure
21+
assert_raise(Socket::ResolutionError) do
22+
t = TCPSocket.open(nil, nil)
23+
ensure
24+
t&.close
25+
end
26+
2127
# These addresses are chosen from TEST-NET-1, TEST-NET-2, and TEST-NET-3.
2228
# [RFC 5737]
2329
# They are chosen because probably they are not used as a host address.

0 commit comments

Comments
 (0)