fork/fish-shell

git clone https://git.julia.blue/fork/fish-shell

Łukasz WieczorekReformat with black.82750bbae

master
1013 B38 linesraw
1#!/usr/bin/env python3
2from pexpect_helper import SpawnedProc
3import re
4
5sp = SpawnedProc()
6send, sendline, sleep, expect_prompt, expect_re, expect_str = (
7    sp.send,
8    sp.sendline,
9    sp.sleep,
10    sp.expect_prompt,
11    sp.expect_re,
12    sp.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(
21    re.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(
32    re.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!")