* test/ruby/test_thread.rb (TestThread#test_kill_thread_subclass):

add test for Thread.kill with Thread subclass instance.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31967 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nagachika 2011-06-09 13:58:09 +00:00
parent d7a3261d28
commit 50a058b6be
2 changed files with 16 additions and 0 deletions

View File

@ -1,3 +1,8 @@
Thu Jun 9 22:53:49 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
* test/ruby/test_thread.rb (TestThread#test_kill_thread_subclass):
add test for Thread.kill with Thread subclass instance.
Thu Jun 9 22:31:47 2011 CHIKANAGA Tomoyuki <nagachika00@gmail.com>
* test/ruby/test_thread.rb (TestThread#test_kill_wrong_argument):

View File

@ -305,6 +305,17 @@ class TestThread < Test::Unit::TestCase
assert_raise(TypeError, bug4367) {
Thread.kill(nil)
}
o = Object.new
assert_raise(TypeError, bug4367) {
Thread.kill(o)
}
end
def test_kill_thread_subclass
c = Class.new(Thread)
t = c.new { sleep 10 }
assert_nothing_raised { Thread.kill(t) }
assert_equal(nil, t.value)
end
def test_exit