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

ruby-changes:40150

From: normal <ko1@a...>
Date: Fri, 23 Oct 2015 07:25:55 +0900 (JST)
Subject: [ruby-changes:40150] normal:r52231 (trunk): test/io/wait/test_io_wait.rb (test_wait_eof): test return value

normal	2015-10-23 07:25:19 +0900 (Fri, 23 Oct 2015)

  New Revision: 52231

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=52231

  Log:
    test/io/wait/test_io_wait.rb (test_wait_eof): test return value
    
    I wrote some code which relies on this nowadays, but Ruby <=2.2
    and earlier behaved differently...

  Modified files:
    trunk/ChangeLog
    trunk/test/io/wait/test_io_wait.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 52230)
+++ ChangeLog	(revision 52231)
@@ -1,3 +1,7 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Fri Oct 23 07:17:11 2015  Eric Wong  <e@8...>
+
+	* test/io/wait/test_io_wait.rb (test_wait_eof): test return value
+
 Fri Oct 23 00:32:02 2015  NARUSE, Yui  <naruse@r...>
 
 	* ext/openssl/ossl_ssl.c (ssl_npn_select_cb): explicitly raise error
Index: test/io/wait/test_io_wait.rb
===================================================================
--- test/io/wait/test_io_wait.rb	(revision 52230)
+++ test/io/wait/test_io_wait.rb	(revision 52231)
@@ -70,9 +70,11 @@ class TestIOWait < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/io/wait/test_io_wait.rb#L70
 
   def test_wait_eof
     th = Thread.new { sleep 0.01; @w.close }
+    ret = nil
     assert_nothing_raised(Timeout::Error) do
-      Timeout.timeout(0.1) {@r.wait}
+      Timeout.timeout(0.1) { ret = @r.wait }
     end
+    assert_equal @r, ret
   ensure
     th.join
   end

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

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