summaryrefslogtreecommitdiff
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
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
-rw-r--r--ChangeLog5
-rw-r--r--test/ruby/test_thread.rb11
2 files changed, 16 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index d26cc67..4d513ac 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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):
diff --git a/test/ruby/test_thread.rb b/test/ruby/test_thread.rb
index c2e592b..524a4fd 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