summaryrefslogtreecommitdiff
path: root/test/socket
diff options
context:
space:
mode:
Diffstat (limited to 'test/socket')
-rw-r--r--test/socket/test_addrinfo.rb2
-rw-r--r--test/socket/test_ancdata.rb2
-rw-r--r--test/socket/test_basicsocket.rb2
-rw-r--r--test/socket/test_nonblock.rb4
-rw-r--r--test/socket/test_socket.rb2
-rw-r--r--test/socket/test_sockopt.rb2
-rw-r--r--test/socket/test_tcp.rb2
-rw-r--r--test/socket/test_udp.rb2
-rw-r--r--test/socket/test_unix.rb4
9 files changed, 20 insertions, 2 deletions
diff --git a/test/socket/test_addrinfo.rb b/test/socket/test_addrinfo.rb
index b83118f5c70..a607a84172d 100644
--- a/test/socket/test_addrinfo.rb
+++ b/test/socket/test_addrinfo.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
begin
require "socket"
rescue LoadError
diff --git a/test/socket/test_ancdata.rb b/test/socket/test_ancdata.rb
index 112b0c9e58b..b2f86a0bb1e 100644
--- a/test/socket/test_ancdata.rb
+++ b/test/socket/test_ancdata.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'test/unit'
require 'socket'
diff --git a/test/socket/test_basicsocket.rb b/test/socket/test_basicsocket.rb
index da977b3be00..227034ed266 100644
--- a/test/socket/test_basicsocket.rb
+++ b/test/socket/test_basicsocket.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
begin
require "socket"
require "test/unit"
diff --git a/test/socket/test_nonblock.rb b/test/socket/test_nonblock.rb
index 55198ba4dde..3f8d548c5e9 100644
--- a/test/socket/test_nonblock.rb
+++ b/test/socket/test_nonblock.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
begin
require "socket"
require "io/nonblock"
@@ -129,7 +131,7 @@ class TestSocketNonblock < Test::Unit::TestCase
mesg = u1.recv_nonblock(100)
assert_equal("", mesg)
- buf = "short"
+ buf = "short".dup
out = "hello world" * 4
out.freeze
u2.send(out, 0, u1.getsockname)
diff --git a/test/socket/test_socket.rb b/test/socket/test_socket.rb
index 3682338b484..26684622e2a 100644
--- a/test/socket/test_socket.rb
+++ b/test/socket/test_socket.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
begin
require "socket"
require "tmpdir"
diff --git a/test/socket/test_sockopt.rb b/test/socket/test_sockopt.rb
index 2ee06dbecdf..0a2937e4fe3 100644
--- a/test/socket/test_sockopt.rb
+++ b/test/socket/test_sockopt.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
require 'test/unit'
require 'socket'
diff --git a/test/socket/test_tcp.rb b/test/socket/test_tcp.rb
index 5e3528e242f..c0e34ebe271 100644
--- a/test/socket/test_tcp.rb
+++ b/test/socket/test_tcp.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
begin
require "socket"
require "test/unit"
diff --git a/test/socket/test_udp.rb b/test/socket/test_udp.rb
index 56933375d77..5b23cce2887 100644
--- a/test/socket/test_udp.rb
+++ b/test/socket/test_udp.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
begin
require "socket"
require "test/unit"
diff --git a/test/socket/test_unix.rb b/test/socket/test_unix.rb
index 9ca97d2998a..313a1f018b5 100644
--- a/test/socket/test_unix.rb
+++ b/test/socket/test_unix.rb
@@ -1,3 +1,5 @@
+# frozen_string_literal: true
+
begin
require "socket"
rescue LoadError
@@ -386,7 +388,7 @@ class TestSocket_UNIXSocket < Test::Unit::TestCase
assert_equal("", s1.recv(10))
assert_raise(IO::EAGAINWaitReadable) { s1.recv_nonblock(10) }
- buf = ""
+ buf = "".dup
s2.send("BBBBBB", 0)
IO.select([s1])
rv = s1.recv(100, 0, buf)