diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-09-21 05:10:14 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2014-09-21 05:10:14 +0000 |
commit | e8bd56f5c34689d1211552863359a219ba2fce7e (patch) | |
tree | a200d085097b0d8e0cf74be7852b3f82b787653d /test | |
parent | c7b257717823607877cfdcf45d9e224541682f41 (diff) | |
download | ruby-e8bd56f5c34689d1211552863359a219ba2fce7e.tar.gz |
signal.c: SIGEXIT is not a system signal
* signal.c (trap): SIGEXIT is not a system signal and is dealt
with internally, so it should not try to register the system
signal handler by sigaction.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47669 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_signal.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/ruby/test_signal.rb b/test/ruby/test_signal.rb index 5c6d379cac..93a497a831 100644 --- a/test/ruby/test_signal.rb +++ b/test/ruby/test_signal.rb @@ -177,6 +177,14 @@ class TestSignal < Test::Unit::TestCase end end + def test_sigexit + assert_in_out_err([], 'Signal.trap(:EXIT) {print "OK"}', ["OK"]) + assert_in_out_err([], 'Signal.trap("EXIT") {print "OK"}', ["OK"]) + assert_in_out_err([], 'Signal.trap(:SIGEXIT) {print "OK"}', ["OK"]) + assert_in_out_err([], 'Signal.trap("SIGEXIT") {print "OK"}', ["OK"]) + assert_in_out_err([], 'Signal.trap(0) {print "OK"}', ["OK"]) + end + def test_kill_immediately_before_termination Signal.list[sig = "USR1"] or sig = "INT" assert_in_out_err(["-e", <<-"end;"], "", %w"foo") |