mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-23 15:31:51 +08:00
Port signal tests to littlecheck
This commit is contained in:
parent
cdbd0891f7
commit
b672e1891e
|
@ -1,8 +1,11 @@
|
|||
# RUN: %fish %s
|
||||
|
||||
function alarm --on-signal ALRM
|
||||
echo ALRM received
|
||||
end
|
||||
|
||||
kill -s ALRM $fish_pid
|
||||
# CHECK: ALRM received
|
||||
|
||||
function anychild --on-process-exit 0
|
||||
# Type and exit status
|
||||
|
@ -11,10 +14,22 @@ end
|
|||
|
||||
echo "command false:"
|
||||
command false
|
||||
# CHECK: command false:
|
||||
# CHECK: PROCESS_EXIT 1
|
||||
# CHECK: JOB_EXIT 0
|
||||
|
||||
echo "command true:"
|
||||
command true
|
||||
# CHECK: command true:
|
||||
# CHECK: PROCESS_EXIT 0
|
||||
# CHECK: JOB_EXIT 0
|
||||
|
||||
echo "command false | true:"
|
||||
command false | command true
|
||||
# CHECK: command false | true:
|
||||
# CHECK: PROCESS_EXIT 1
|
||||
# CHECK: PROCESS_EXIT 0
|
||||
# CHECK: JOB_EXIT 0
|
||||
|
||||
function test_blocks
|
||||
block -l
|
||||
|
@ -22,4 +37,11 @@ function test_blocks
|
|||
echo "This should come before the event handler"
|
||||
end
|
||||
test_blocks
|
||||
# CHECK: This is the process whose exit event shuld be blocked
|
||||
# CHECK: This should come before the event handler
|
||||
|
||||
echo "Now event handler should have run"
|
||||
# CHECK: PROCESS_EXIT 0
|
||||
# CHECK: JOB_EXIT 0
|
||||
# CHECK: Now event handler should have run
|
||||
# CHECK: PROCESS_EXIT 0
|
|
@ -1,17 +0,0 @@
|
|||
ALRM received
|
||||
command false:
|
||||
PROCESS_EXIT 1
|
||||
JOB_EXIT 0
|
||||
command true:
|
||||
PROCESS_EXIT 0
|
||||
JOB_EXIT 0
|
||||
command false | true:
|
||||
PROCESS_EXIT 1
|
||||
PROCESS_EXIT 0
|
||||
JOB_EXIT 0
|
||||
This is the process whose exit event shuld be blocked
|
||||
This should come before the event handler
|
||||
PROCESS_EXIT 0
|
||||
JOB_EXIT 0
|
||||
Now event handler should have run
|
||||
PROCESS_EXIT 0
|
Loading…
Reference in New Issue
Block a user