diff options
author | tarui <tarui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-28 13:24:36 +0000 |
---|---|---|
committer | tarui <tarui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-11-28 13:24:36 +0000 |
commit | c6557c6fabfac078bda4ce19f1d1cda425998e48 (patch) | |
tree | c5c8edeb65037bda886512babec6de7d934543f4 /test/ruby/test_thread.rb | |
parent | 9d0de48e662046d870e38a21771cbe939031051a (diff) | |
download | ruby-c6557c6fabfac078bda4ce19f1d1cda425998e48.tar.gz |
* test/ruby/test_thread.rb (test_thread_status_in_trap): change test for
thread status in trap. now can accept Thread#join and Thread#value in trap.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37939 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_thread.rb')
-rw-r--r-- | test/ruby/test_thread.rb | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/test/ruby/test_thread.rb b/test/ruby/test_thread.rb index 45f389b0fa..dfad5f6b34 100644 --- a/test/ruby/test_thread.rb +++ b/test/ruby/test_thread.rb @@ -857,7 +857,7 @@ class TestThreadGroup < Test::Unit::TestCase end def test_thread_join_in_trap - assert_raise(ThreadError) { + assert_nothing_raised{ t = Thread.new{ sleep 0.2; Process.kill(:INT, $$) } Signal.trap :INT do @@ -867,16 +867,16 @@ class TestThreadGroup < Test::Unit::TestCase t.join } - assert_raise(ThreadError) { - t = Thread.new{ sleep 0.2; Process.kill(:INT, $$) } - - Signal.trap :INT do - t.value - end - - t.value - } - + assert_equal(:normal_end, + begin + t = Thread.new{ sleep 0.2; Process.kill(:INT, $$); :normal_end } + + Signal.trap :INT do + t.value + end + t.value + end + ) end def test_thread_join_current |