Help fg.py test pass more on macOS

This commit is contained in:
ridiculousfish 2024-05-05 17:44:34 -07:00
parent 7b524f6995
commit f6f1d93df5

View file

@ -2,6 +2,7 @@
from pexpect_helper import SpawnedProc
import os
import platform
import signal
import subprocess
import sys
import time
@ -33,22 +34,23 @@ send("\x1A")
sleep(1.2)
expect_prompt()
sendline("set -l foo bar; echo $foo")
expect_str("bar")
expect_prompt("bar")
expect_prompt()
sendline("fg")
expect_str("Send job 1 (" + testproc + ") to foreground")
sleep(0.2)
sendline("set -l foo bar; echo $foo")
expect_str("")
# ctrl-c - cancel
send("\x03")
# Beware: Mac pkill requires that the -P argument come before the process name,
# else the -P argument is ignored.
subprocess.call(["pkill", "-INT", "-P", str(sp.spawn.pid), "sleep"])
expect_prompt()
sendline("set -l foo bar; echo $foo")
expect_str("bar")
expect_prompt("bar")
expect_prompt()
sendline("echo 'Catch' 'up'")
expect_prompt("Catch up")
# Regression test for #7483.
# Ensure we can background a job after a different backgrounded job completes.