fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
82750bbae
master
1#!/usr/bin/env python3 2from pexpect_helper import SpawnedProc 3import re 4 5sp = SpawnedProc () 6send ,sendline ,sleep ,expect_prompt ,expect_re ,expect_str = ( 7sp .send , 8sp .sendline , 9sp .sleep , 10sp .expect_prompt , 11sp .expect_re , 12sp .expect_str , 13) 14expect_prompt () 15 16# Regression test for 9796 17# If a process in the prompt exits with a status that would cause a message to be printed, 18# don't trigger another prompt execution which would result in an infinite loop. 19sendline ("sh -c 'kill -ABRT $$'" ) 20expect_prompt ( 21re .escape ( 22"fish: Job 1, 'sh -c 'kill -ABRT $$'' terminated by signal SIGABRT (Abort)" 23 ) 24) 25 26# Copy current prompt so we can reuse it. 27sendline ("functions --copy fish_prompt fish_prompt_orig" ) 28expect_prompt () 29 30sendline ("function fish_prompt; sh -c 'kill -ABRT $$'; fish_prompt_orig; end" ) 31expect_prompt ( 32re .escape ( 33"fish: Job 1, 'sh -c 'kill -ABRT $$'' terminated by signal SIGABRT (Abort)" 34 ) 35) 36 37sendline ("echo still alive!" ) 38expect_prompt ("still alive!" )