* 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:
parent
de6f26a296
commit
8405551e6d
@ -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>
|
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()
|
* gc.c (gc_sweep): loosen page free condition to avoid add_heap()
|
||||||
|
@ -4,9 +4,10 @@ $KCODE = 'none'
|
|||||||
|
|
||||||
class TestSignal < Test::Unit::TestCase
|
class TestSignal < Test::Unit::TestCase
|
||||||
def test_signal
|
def test_signal
|
||||||
if defined? Process.kill
|
defined?(Process.kill) or return
|
||||||
|
begin
|
||||||
$x = 0
|
$x = 0
|
||||||
trap "SIGINT", proc{|sig| $x = 2}
|
oldtrap = trap "SIGINT", proc{|sig| $x = 2}
|
||||||
Process.kill "SIGINT", $$
|
Process.kill "SIGINT", $$
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
assert_equal(2, $x)
|
assert_equal(2, $x)
|
||||||
@ -19,6 +20,8 @@ class TestSignal < Test::Unit::TestCase
|
|||||||
end
|
end
|
||||||
assert(x)
|
assert(x)
|
||||||
assert_match(/Interrupt/, x.message)
|
assert_match(/Interrupt/, x.message)
|
||||||
|
ensure
|
||||||
|
trap "SIGINT", oldtrap
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user