summaryrefslogtreecommitdiff
path: root/test/ruby/test_thread.rb
diff options
context:
space:
mode:
authornagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-06-09 13:58:09 +0000
committernagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-06-09 13:58:09 +0000
commit50a058b6beb55998b6d06b912bb8ffeb9131e6af (patch)
treeadd67e7d9562a9151f4a62e8b25ae46c640ec00d /test/ruby/test_thread.rb
parentd7a3261d28371d80ded8d308110ee46364fcc1f7 (diff)
* 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
Diffstat (limited to 'test/ruby/test_thread.rb')
-rw-r--r--test/ruby/test_thread.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ruby/test_thread.rb b/test/ruby/test_thread.rb
index c2e592bb4b0..524a4fd14c3 100644
--- a/test/ruby/test_thread.rb
+++ b/test/ruby/test_thread.rb
@@ -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