summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2025-03-15 00:36:04 +0900
committerNobuyoshi Nakada <nobu.nakada@gmail.com>2025-03-15 15:50:46 +0900
commit29c0ca58c22b25dbd323d1ba5cdcf6dbdfd505e5 (patch)
treefed5da81954369d0a84650366cdbd2e9cf69ec15 /test
parentb148dfef5aa208cafa28626fd84c9762bfdfe0ac (diff)
Test for the crash
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/12934
Diffstat (limited to 'test')
-rw-r--r--test/socket/test_tcp.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/socket/test_tcp.rb b/test/socket/test_tcp.rb
index e6a41f5660..3cc3e18841 100644
--- a/test/socket/test_tcp.rb
+++ b/test/socket/test_tcp.rb
@@ -18,6 +18,12 @@ class TestSocket_TCPSocket < Test::Unit::TestCase
end
def test_initialize_failure
+ assert_raise(Socket::ResolutionError) do
+ t = TCPSocket.open(nil, nil)
+ ensure
+ t&.close
+ end
+
# These addresses are chosen from TEST-NET-1, TEST-NET-2, and TEST-NET-3.
# [RFC 5737]
# They are chosen because probably they are not used as a host address.