diff options
Diffstat (limited to 'tcltests/test_trysignal.tcl')
-rw-r--r-- | tcltests/test_trysignal.tcl | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tcltests/test_trysignal.tcl b/tcltests/test_trysignal.tcl new file mode 100644 index 0000000..5a87045 --- /dev/null +++ b/tcltests/test_trysignal.tcl @@ -0,0 +1,16 @@ +signal handle ALRM + +alarm 1 +try -signal { + foreach i {1 2 3 4 5} { + sleep 0.4 + } + set msg "" +} on signal {msg} { + # Just set msg here +} finally { + alarm 0 +} + +check trysignal.1 $msg SIGALRM +check trysignal.2 [expr {$i in {2 3}}] 1 |