summaryrefslogtreecommitdiff
path: root/test/socket/test_unix.rb
diff options
context:
space:
mode:
authorJean Boussier <[email protected]>2023-08-31 09:23:30 +0200
committerJean Boussier <[email protected]>2023-08-31 16:43:58 +0200
commit0270210e4984957427a4cf3824b724b62bfa2eaf (patch)
treee5486cb287ed850e9cc267729a54c6d00eb5ffd7 /test/socket/test_unix.rb
parentb8e782c1b5d0c13c97160d1bae5bdc95c0fca1f8 (diff)
TestSocket_UNIXSocket: stop testing empty packets
OpenBSD and Solaris behave differently here. Linux does deliver the empty packet, which is questionable as it's undistinguishable from a closed connection. It seems that OpenBSD and Solaris simply drop it. We could test the platform before doing the assertion, but it would likely be fragile, and the entire web recommend to not ever send an empty packet, so the value of this assertion is low.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/8338
Diffstat (limited to 'test/socket/test_unix.rb')
-rw-r--r--test/socket/test_unix.rb2
1 files changed, 0 insertions, 2 deletions
diff --git a/test/socket/test_unix.rb b/test/socket/test_unix.rb
index 9d9faa4387..b2da1e439d 100644
--- a/test/socket/test_unix.rb
+++ b/test/socket/test_unix.rb
@@ -488,9 +488,7 @@ class TestSocket_UNIXSocket < Test::Unit::TestCase
assert_kind_of(IO::WaitReadable, e)
end
- s2.send("", 0)
s2.send("haha", 0)
- assert_equal(nil, s1.recv(10)) # no way to distinguish empty packet from EOF with SOCK_SEQPACKET
assert_equal("haha", s1.recv(10))
assert_raise(IO::EWOULDBLOCKWaitReadable) { s1.recv_nonblock(10) }