summaryrefslogtreecommitdiff
path: root/test/socket
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-23 15:31:22 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-01-23 15:31:22 +0000
commita41005eb6a99376ea940888bcf97140643d18f61 (patch)
treec4821286d632e7de063731fc8cd9affd337c2b33 /test/socket
parentd6aa4916b8af01df29b7373b5064f23a6105c258 (diff)
downloadbundler-a41005eb6a99376ea940888bcf97140643d18f61.tar.gz
init.c: encode socket error message
* ext/socket/init.c (rsock_raise_socket_error): on Windows, encode error messages from wide characters to the default encodings. [ruby-core:84972] [Bug #14384] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62017 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/socket')
-rw-r--r--test/socket/test_addrinfo.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/socket/test_addrinfo.rb b/test/socket/test_addrinfo.rb
index 132d172380..a06f3eb451 100644
--- a/test/socket/test_addrinfo.rb
+++ b/test/socket/test_addrinfo.rb
@@ -102,6 +102,14 @@ class TestSocketAddrinfo < Test::Unit::TestCase
assert(!ipv4_ai.unix?)
end
+ def test_error_message
+ e = assert_raise_with_message(SocketError, /getaddrinfo:/) do
+ Addrinfo.ip("...")
+ end
+ m = e.message
+ assert_not_equal([false, Encoding::ASCII_8BIT], [m.ascii_only?, m.encoding], proc {m.inspect})
+ end
+
def test_ipv4_address_predicates
list = [
[:ipv4_private?, "10.0.0.0", "10.255.255.255",