зеркало из https://github.com/github/ruby.git
Relax test conditions to velify Socket::ResolutionError#error_code
The test for Socket::ResolutionError#error_code fails in the FreeBSD environment with this test condition. Because Socket::ResolutionError#error_code returns Socket::EAI_FAIL instead of Socket::EAI_FAMILY. https://rubyci.s3.amazonaws.com/freebsd12/ruby-master/log/20231130T103002Z.fail.html.gz This PR avoids the test failure by relaxing the condition. Also changed the domain for testing to `example.com`.
This commit is contained in:
Родитель
e2bbbacc23
Коммит
1bfd30a1e3
|
@ -771,13 +771,10 @@ class TestSocket < Test::Unit::TestCase
|
|||
end
|
||||
|
||||
def test_resolurion_error_error_code
|
||||
# https://rubyci.s3.amazonaws.com/freebsd12/ruby-master/log/20231130T103002Z.fail.html.gz
|
||||
omit if /freebsd/ =~ RUBY_PLATFORM
|
||||
|
||||
begin
|
||||
Socket.getaddrinfo("www.kame.net", 80, "AF_UNIX")
|
||||
Socket.getaddrinfo("example.com", 80, "AF_UNIX")
|
||||
rescue => e
|
||||
assert_equal(Socket::EAI_FAMILY, e.error_code)
|
||||
assert_equal([Socket::EAI_FAMILY, Socket::EAI_FAIL].include?(e.error_code), true)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче