Add a tricky test to verify disowning an in-flight job

There's some logic in fish to prevent blowing up when an under-construction
job is disowned. Add a test for it.
This commit is contained in:
ridiculousfish
2019-12-08 11:44:21 -08:00
parent 2ec8cd3bca
commit d47541a3d7
2 changed files with 22 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
# RUN: env fish_test_helper=%fish_test_helper %fish %s
# Ensure that a job which attempts to disown itself does not explode.
# Here fish_test_helper is the process group leader; we attempt to disown
# its pid within a pipeline containing it.
function disowner
read -l pid
echo Disown $pid
disown $pid
end
$fish_test_helper print_pid_then_sleep | disowner
# CHECK: Disown {{\d+}}