mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-21 03:21:16 -03:00
bg/fg/wait/disown/function: check for negative PID argument
While at it, extract a function.
Seems to have regressed in 4.0.0 (fc47d9fa1d (Use strongly typed
`Pid` for job control, 2024-11-11)).
Fixes #11929
This commit is contained in:
@@ -147,7 +147,7 @@ rm -r $tmpdir
|
||||
functions -e foo
|
||||
|
||||
function foo -p bar; end
|
||||
# CHECKERR: {{.*}}function.fish (line {{\d+}}): function: bar: invalid process ID
|
||||
# CHECKERR: {{.*}}function.fish (line {{\d+}}): function: 'bar' is not a valid process ID
|
||||
# CHECKERR: function foo -p bar; end
|
||||
# CHECKERR: ^~~~~~~~~~~~~~~~~~~^
|
||||
|
||||
@@ -214,4 +214,29 @@ end
|
||||
outer 1 2 3
|
||||
#CHECK: 1 2 3
|
||||
|
||||
for flag in --on-process-exit --on-job-exit
|
||||
for invalid_pid in (math 2 ^ 31) -1 -(math 2 ^ 31)
|
||||
function invalid $flag=$invalid_pid
|
||||
end
|
||||
end
|
||||
# CHECKERR: {{.*}}/function.fish (line {{\d+}}): function: '2147483648' is not a valid process ID
|
||||
# CHECKERR: function invalid $flag=$invalid_pid
|
||||
# CHECKERR: ^
|
||||
# CHECKERR: {{.*}}/function.fish (line {{\d+}}): function: '-1' is not a valid process ID
|
||||
# CHECKERR: function invalid $flag=$invalid_pid
|
||||
# CHECKERR: ^
|
||||
# CHECKERR: {{.*}}/function.fish (line {{\d+}}): function: '-2147483648' is not a valid process ID
|
||||
# CHECKERR: function invalid $flag=$invalid_pid
|
||||
# CHECKERR: ^
|
||||
# CHECKERR: {{.*}}/function.fish (line {{\d+}}): function: '2147483648' is not a valid process ID
|
||||
# CHECKERR: function invalid $flag=$invalid_pid
|
||||
# CHECKERR: ^
|
||||
# CHECKERR: {{.*}}/function.fish (line {{\d+}}): function: '-1' is not a valid process ID
|
||||
# CHECKERR: function invalid $flag=$invalid_pid
|
||||
# CHECKERR: ^
|
||||
# CHECKERR: {{.*}}/function.fish (line {{\d+}}): function: '-2147483648' is not a valid process ID
|
||||
# CHECKERR: function invalid $flag=$invalid_pid
|
||||
# CHECKERR: ^
|
||||
end
|
||||
|
||||
exit 0
|
||||
|
||||
Reference in New Issue
Block a user