ruby-changes:4688
From: ko1@a...
Date: Thu, 24 Apr 2008 23:02:40 +0900 (JST)
Subject: [ruby-changes:4688] mame - Ruby:r16182 (trunk): * test/ruby/test_thread.rb: fix typos.
mame 2008-04-24 23:02:15 +0900 (Thu, 24 Apr 2008)
New Revision: 16182
Modified files:
trunk/ChangeLog
trunk/test/ruby/envutil.rb
trunk/test/ruby/test_thread.rb
Log:
* test/ruby/test_thread.rb: fix typos.
* test/ruby/envutil.rb (rubyexec): move Open3.popen3 call into timeout
block.
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=16182&r2=16181&diff_format=u
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/test/ruby/envutil.rb?r1=16182&r2=16181&diff_format=u
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/test/ruby/test_thread.rb?r1=16182&r2=16181&diff_format=u
Index: ChangeLog
===================================================================
--- ChangeLog (revision 16181)
+++ ChangeLog (revision 16182)
@@ -1,3 +1,10 @@
+Thu Apr 24 23:00:58 2008 Yusuke Endoh <mame@t...>
+
+ * test/ruby/test_thread.rb: fix typos.
+
+ * test/ruby/envutil.rb (rubyexec): move Open3.popen3 call into timeout
+ block.
+
Thu Apr 24 22:34:52 2008 Yusuke Endoh <mame@t...>
* test/ruby/test_comparable.rb: new tests for Comparable, to achieve
Index: test/ruby/envutil.rb
===================================================================
--- test/ruby/envutil.rb (revision 16181)
+++ test/ruby/envutil.rb (revision 16182)
@@ -43,16 +43,17 @@
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
Index: test/ruby/test_thread.rb
===================================================================
--- test/ruby/test_thread.rb (revision 16181)
+++ test/ruby/test_thread.rb (revision 16182)
@@ -109,12 +109,12 @@
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 @@
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
--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/