aboutsummaryrefslogtreecommitdiffstats
path: root/test/ruby/test_thread.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/ruby/test_thread.rb')
-rw-r--r--test/ruby/test_thread.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/ruby/test_thread.rb b/test/ruby/test_thread.rb
index d076494cdf..78ed329274 100644
--- a/test/ruby/test_thread.rb
+++ b/test/ruby/test_thread.rb
@@ -1057,4 +1057,22 @@ q.pop
t.kill
t.join
end
+
+ def test_thread_invalid_name
+ bug11756 = '[ruby-core:71774] [Bug #11756]'
+ t = Thread.start {}
+ assert_raise(ArgumentError, bug11756) {t.name = "foo\0bar"}
+ ensure
+ t.kill
+ t.join
+ end
+
+ def test_thread_invalid_object
+ bug11756 = '[ruby-core:71774] [Bug #11756]'
+ t = Thread.start {}
+ assert_raise(TypeError, bug11756) {t.name = nil}
+ ensure
+ t.kill
+ t.join
+ end
end