summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/-ext-/old_thread_select/test_old_thread_select.rb15
1 files changed, 13 insertions, 2 deletions
diff --git a/test/-ext-/old_thread_select/test_old_thread_select.rb b/test/-ext-/old_thread_select/test_old_thread_select.rb
index 18235b845a..1ccdb3414d 100644
--- a/test/-ext-/old_thread_select/test_old_thread_select.rb
+++ b/test/-ext-/old_thread_select/test_old_thread_select.rb
@@ -23,6 +23,17 @@ class TestOldThreadSelect < Test::Unit::TestCase
end
end
+ def test_old_select_error_timeout
+ bug5299 = '[ruby-core:39380]'
+ with_pipe do |r, w|
+ t0 = Time.now
+ rc = IO.old_thread_select(nil, nil, [r.fileno], 0.001)
+ diff = Time.now - t0
+ assert_equal 0, rc, bug5299
+ assert_operator diff, :>=, 0.001, "returned too early"
+ end
+ end
+
def test_old_select_false_positive
bug5306 = '[ruby-core:39435]'
with_pipe do |r2, w2|
@@ -77,7 +88,7 @@ class TestOldThreadSelect < Test::Unit::TestCase
assert_equal 0, rc
assert_equal true, thr.value
assert received, "SIGINT not received"
- ensure
- trap(:INT, "DEFAULT")
+ ensure
+ trap(:INT, "DEFAULT")
end
end