diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/socket/test_unix.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/socket/test_unix.rb b/test/socket/test_unix.rb index 7edb5e5d4f..e4408630d4 100644 --- a/test/socket/test_unix.rb +++ b/test/socket/test_unix.rb @@ -285,6 +285,16 @@ class TestSocket_UNIXSocket < Test::Unit::TestCase File.unlink path if path && File.socket?(path) end + def test_open_nul_byte + tmpfile = Tempfile.new("s") + path = tmpfile.path + tmpfile.close(true) + assert_raise(ArgumentError) {UNIXServer.open(path+"\0")} + assert_raise(ArgumentError) {UNIXSocket.open(path+"\0")} + ensure + File.unlink path if path && File.socket?(path) + end + def test_addr bound_unix_socket(UNIXServer) {|serv, path| UNIXSocket.open(path) {|c| |