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

ruby-changes:34078

From: hsbt <ko1@a...>
Date: Tue, 27 May 2014 17:00:37 +0900 (JST)
Subject: [ruby-changes:34078] hsbt:r46159 (trunk): * test/test_timeout.rb (test_timeout): inverted test condition.

hsbt	2014-05-27 17:00:19 +0900 (Tue, 27 May 2014)

  New Revision: 46159

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

  Log:
    * test/test_timeout.rb (test_timeout): inverted test condition.
      [Bug #8523]

  Modified files:
    trunk/ChangeLog
    trunk/test/test_timeout.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 46158)
+++ ChangeLog	(revision 46159)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Tue May 27 16:58:12 2014  SHIBATA Hiroshi  <shibata.hiroshi@g...>
+
+	* test/test_timeout.rb (test_timeout): inverted test condition.
+	  [Bug #8523]
+
 Tue May 27 12:24:22 2014  Tanaka Akira  <akr@f...>
 
 	* test/lib/minitest/unit.rb: Show leaked file descriptors.
Index: test/test_timeout.rb
===================================================================
--- test/test_timeout.rb	(revision 46158)
+++ test/test_timeout.rb	(revision 46159)
@@ -13,15 +13,15 @@ class TestTimeout < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/test_timeout.rb#L13
   def test_timeout
     flag = true
     Thread.start {
-      sleep 0.01
+      sleep 1
       flag = false
     }
-    assert_nothing_raised("[ruby-dev:38319]") do
-      Timeout.timeout(1) {
+    assert_raise(Timeout::Error, "[ruby-dev:38319]") do
+      Timeout.timeout(0.1) {
         Thread.pass while flag
       }
     end
-    assert !flag, "[ruby-dev:38319]"
+    assert flag, "[ruby-dev:38319]"
   end
 
   def test_cannot_convert_into_time_interval

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

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