1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* test/ruby/test_io.rb (TestIO#test_ungetc2): get rid of busy loop.

* test/ruby/test_signal.rb (TestSignal#test_signal2): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31746 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2011-05-27 13:37:37 +00:00
parent 83e216b670
commit faaf8ea8af
2 changed files with 5 additions and 5 deletions

View file

@ -827,7 +827,7 @@ class TestIO < Test::Unit::TestCase
def test_ungetc2 def test_ungetc2
f = false f = false
pipe(proc do |w| pipe(proc do |w|
0 until f Thread.pass until f
w.write("1" * 10000) w.write("1" * 10000)
w.close w.close
end, proc do |r| end, proc do |r|

View file

@ -119,21 +119,21 @@ class TestSignal < Test::Unit::TestCase
Timeout.timeout(10) do Timeout.timeout(10) do
x = false x = false
Process.kill(SignalException.new(:INT).signo, $$) Process.kill(SignalException.new(:INT).signo, $$)
nil until x sleep(0.01) until x
x = false x = false
Process.kill("INT", $$) Process.kill("INT", $$)
nil until x sleep(0.01) until x
x = false x = false
Process.kill("SIGINT", $$) Process.kill("SIGINT", $$)
nil until x sleep(0.01) until x
x = false x = false
o = Object.new o = Object.new
def o.to_str; "SIGINT"; end def o.to_str; "SIGINT"; end
Process.kill(o, $$) Process.kill(o, $$)
nil until x sleep(0.01) until x
end end
assert_raise(ArgumentError) { Process.kill(Object.new, $$) } assert_raise(ArgumentError) { Process.kill(Object.new, $$) }