diff options
-rw-r--r-- | ChangeLog | 10 | ||||
-rw-r--r-- | test/ruby/test_signal.rb | 7 |
2 files changed, 12 insertions, 5 deletions
@@ -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() @@ -77,7 +81,7 @@ Thu Oct 16 23:51:04 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp> * ext/tk/lib/tk.rb: If $DEBUG == true and some exception is caused in a callback operation, Ruby/Tk shows a (verbose) backtrace - information on the callback process. + information on the callback process. Thu Oct 16 17:09:19 2003 Yukihiro Matsumoto <matz@ruby-lang.org> @@ -91,8 +95,8 @@ Thu Oct 16 16:54:57 2003 Yukihiro Matsumoto <matz@ruby-lang.org> Thu Oct 16 16:40:51 2003 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp> - * ext/tk/lib/tk.rb: - Add Tk::EncodedString and Tk::UTF8_String class to support + * ext/tk/lib/tk.rb: + Add Tk::EncodedString and Tk::UTF8_String class to support characters using the \uXXXX escape to the UNICODE string. * ext/tk/sample/{demos-en,demos-jp}/unicodeout.rb diff --git a/test/ruby/test_signal.rb b/test/ruby/test_signal.rb index 61240cd65d..77c97be98c 100644 --- a/test/ruby/test_signal.rb +++ b/test/ruby/test_signal.rb @@ -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 |