diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-01 14:36:42 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-01 14:36:42 +0000 |
commit | cc9ec7da69f55dd8b861a1830e2d197c75f7efa6 (patch) | |
tree | dcef9295c94b97e46b8157c9153920454cea9439 /test/ruby | |
parent | 42edb7ec8ab158f0ced9c99e7a34588ecdfa41cd (diff) | |
download | ruby-cc9ec7da69f55dd8b861a1830e2d197c75f7efa6.tar.gz |
thread.c: reset name
* thread.c (rb_thread_setname): allow to reset thread name.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52835 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby')
-rw-r--r-- | test/ruby/test_thread.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/test/ruby/test_thread.rb b/test/ruby/test_thread.rb index 78ed329274..0affca294a 100644 --- a/test/ruby/test_thread.rb +++ b/test/ruby/test_thread.rb @@ -1050,9 +1050,14 @@ q.pop end def test_thread_name - t = Thread.start { sleep } + t = Thread.start {} + assert_nil t.name + s = t.inspect t.name = 'foo' assert_equal 'foo', t.name + t.name = nil + assert_nil t.name + assert_equal s, t.inspect ensure t.kill t.join @@ -1070,7 +1075,7 @@ q.pop def test_thread_invalid_object bug11756 = '[ruby-core:71774] [Bug #11756]' t = Thread.start {} - assert_raise(TypeError, bug11756) {t.name = nil} + assert_raise(TypeError, bug11756) {t.name = []} ensure t.kill t.join |