* test/ruby/test_signal.rb (test_signal): restore old trap.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2003-10-20 02:31:47 +00:00
parent de6f26a296
commit 8405551e6d
2 changed files with 12 additions and 5 deletions

View File

@ -1,3 +1,7 @@
Mon Oct 20 11:31:44 2003 Nobuyoshi Nakada <nobu@ruby-lang.org>
* test/ruby/test_signal.rb (test_signal): restore old trap.
Mon Oct 20 11:00:46 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
* gc.c (gc_sweep): loosen page free condition to avoid add_heap()

View File

@ -4,9 +4,10 @@ $KCODE = 'none'
class TestSignal < Test::Unit::TestCase
def test_signal
if defined? Process.kill
defined?(Process.kill) or return
begin
$x = 0
trap "SIGINT", proc{|sig| $x = 2}
oldtrap = trap "SIGINT", proc{|sig| $x = 2}
Process.kill "SIGINT", $$
sleep 0.1
assert_equal(2, $x)
@ -19,6 +20,8 @@ class TestSignal < Test::Unit::TestCase
end
assert(x)
assert_match(/Interrupt/, x.message)
ensure
trap "SIGINT", oldtrap
end
end
end