mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Update UnixSocket#recv_io tests to handle receiving a UnixSocket
Receiving UnixSocket works fine if you don't provide a mode, and I think it is reasonable to expect that you should not provide a mode if klass.for_fd would not accept a mode. Fixes [Bug #11778]
This commit is contained in:
parent
b904b72960
commit
ed27c2514c
Notes:
git
2020-09-23 07:45:00 +09:00
1 changed files with 8 additions and 2 deletions
|
@ -47,10 +47,16 @@ class TestSocket_UNIXSocket < Test::Unit::TestCase
|
||||||
r.close
|
r.close
|
||||||
|
|
||||||
s1.send_io(s1)
|
s1.send_io(s1)
|
||||||
# klass = UNIXSocket FIXME: [ruby-core:71860] [Bug #11778]
|
klass = UNIXSocket
|
||||||
|
r = s2.recv_io(klass)
|
||||||
|
assert_instance_of klass, r, 'recv_io with proper klass'
|
||||||
|
assert_not_equal s1.fileno, r.fileno
|
||||||
|
r.close
|
||||||
|
|
||||||
|
s1.send_io(s1)
|
||||||
klass = IO
|
klass = IO
|
||||||
r = s2.recv_io(klass, 'r+')
|
r = s2.recv_io(klass, 'r+')
|
||||||
assert_instance_of klass, r, 'recv_io with proper klass'
|
assert_instance_of klass, r, 'recv_io with proper klass and mode'
|
||||||
assert_not_equal s1.fileno, r.fileno
|
assert_not_equal s1.fileno, r.fileno
|
||||||
r.close
|
r.close
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue