pvalena / rpms / ruby

Forked from rpms/ruby 3 years ago
Clone
117278a
--- ruby-1.9.3-p0/test/ruby/test_bignum.rb.orig	2011-11-10 09:52:59.101925465 +0100
117278a
+++ ruby-1.9.3-p0/test/ruby/test_bignum.rb	2011-11-10 09:54:14.580798826 +0100
117278a
@@ -378,7 +378,7 @@
117278a
     assert_equal(true, (2**32).even?)
117278a
   end
117278a
 
117278a
-  def interrupt
117278a
+  def assert_interrupt
117278a
     time = Time.now
117278a
     start_flag = false
117278a
     end_flag = false
117278a
@@ -387,14 +387,16 @@
117278a
       yield
117278a
       end_flag = true
117278a
     end
117278a
-    sleep 1
117278a
+    Thread.pass until start_flag
117278a
     thread.raise
117278a
     thread.join rescue nil
117278a
-    start_flag && !end_flag && Time.now - time < 10
117278a
+    time = Time.now - time
117278a
+    assert_equal([true, false], [start_flag, end_flag])
117278a
+    assert_operator(time, :<, 10)
117278a
   end
117278a
 
117278a
   def test_interrupt
117278a
-    assert(interrupt { (65536 ** 65536).to_s })
117278a
+    assert_interrupt {(65536 ** 65536).to_s}
117278a
   end
117278a
 
117278a
   def test_too_big_to_s