diff options
author | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-04-24 14:02:15 +0000 |
---|---|---|
committer | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-04-24 14:02:15 +0000 |
commit | 9b694aaa8588a1f43fd0ae8c1142c7a854a3f6c6 (patch) | |
tree | 94f897b9af7d25d7fea9e6903630edc5e8ab2d73 /test | |
parent | c8d27afcd6b5cee8cc0d5aac1f67e81fdc2971ac (diff) | |
download | ruby-9b694aaa8588a1f43fd0ae8c1142c7a854a3f6c6.tar.gz |
* test/ruby/test_thread.rb: fix typos.
* test/ruby/envutil.rb (rubyexec): move Open3.popen3 call into timeout
block.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16182 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/envutil.rb | 19 | ||||
-rw-r--r-- | test/ruby/test_thread.rb | 8 |
2 files changed, 14 insertions, 13 deletions
diff --git a/test/ruby/envutil.rb b/test/ruby/envutil.rb index 37efdde84e..4d0ff6b6a2 100644 --- a/test/ruby/envutil.rb +++ b/test/ruby/envutil.rb @@ -43,16 +43,17 @@ module EnvUtil c = "C" env = {} LANG_ENVS.each {|lc| env[lc], ENV[lc] = ENV[lc], c} - stdin, stdout, stderr = Open3.popen3(*([ruby] + args)) - env.each_pair {|lc, v| - if v - ENV[lc] = v - else - ENV.delete(lc) - end - } - env = nil + stdin = stdout = stderr = nil Timeout.timeout(10) do + stdin, stdout, stderr = Open3.popen3(*([ruby] + args)) + env.each_pair {|lc, v| + if v + ENV[lc] = v + else + ENV.delete(lc) + end + } + env = nil yield(stdin, stdout, stderr) end diff --git a/test/ruby/test_thread.rb b/test/ruby/test_thread.rb index b03b60b72a..bdb9ec24f5 100644 --- a/test/ruby/test_thread.rb +++ b/test/ruby/test_thread.rb @@ -109,12 +109,12 @@ class TestThread < Test::Unit::TestCase t1.priority = -1 t2 = Thread.new { loop { c2 += 1 } } t2.priority = -3 - assert(-1, t1.priority) - assert(-3, t2.priority) + assert_equal(-1, t1.priority) + assert_equal(-3, t2.priority) sleep 0.5 t1.kill t2.kill - #assert(c1 > c2 * 2, "[ruby-dev:33124]") + assert(c1 > c2 * 2, "[ruby-dev:33124]") end def test_new @@ -384,7 +384,7 @@ class TestThread < Test::Unit::TestCase def test_select_wait assert_nil(IO.select(nil, nil, nil, 1)) t = Thread.new do - assert_nil(IO.select(nil, nil, nil, nil)) + IO.select(nil, nil, nil, nil) end sleep 0.5 t.kill |