[前][次][番号順一覧][スレッド一覧]

ruby-changes:63045

From: Jeremy <ko1@a...>
Date: Wed, 23 Sep 2020 07:44:54 +0900 (JST)
Subject: [ruby-changes:63045] ed27c2514c (master): Update UnixSocket#recv_io tests to handle receiving a UnixSocket

https://git.ruby-lang.org/ruby.git/commit/?id=ed27c2514c

From ed27c2514c2f4140546dce2e8f5f64cb91712c47 Mon Sep 17 00:00:00 2001
From: Jeremy Evans <code@j...>
Date: Tue, 22 Sep 2020 14:04:01 -0700
Subject: 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]

diff --git a/test/socket/test_unix.rb b/test/socket/test_unix.rb
index e9c90be..8c74d0c 100644
--- a/test/socket/test_unix.rb
+++ b/test/socket/test_unix.rb
@@ -47,10 +47,16 @@ class TestSocket_UNIXSocket < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/socket/test_unix.rb#L47
       r.close
 
       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
       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
       r.close
     end
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]