mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-28 13:53:10 +00:00
[tests] Add count to "Wacky Handler" text
This makes it easier to figure out where the failure is taking place when the output mismatches and the contents of the buffer are printed.
This commit is contained in:
parent
32f7f5bd32
commit
f1266dd8f5
1 changed files with 15 additions and 4 deletions
|
@ -23,6 +23,8 @@ expect_prompt()
|
||||||
# Set up a handler for SIGUSR1.
|
# Set up a handler for SIGUSR1.
|
||||||
sendline(r"set -g sigusr1_count 0")
|
sendline(r"set -g sigusr1_count 0")
|
||||||
expect_prompt()
|
expect_prompt()
|
||||||
|
sendline(r"set -g wacky_count 0")
|
||||||
|
expect_prompt()
|
||||||
|
|
||||||
sendline(
|
sendline(
|
||||||
r"""
|
r"""
|
||||||
|
@ -38,7 +40,16 @@ sendline(
|
||||||
expect_prompt()
|
expect_prompt()
|
||||||
|
|
||||||
# Set up a wacky binding with an escape.
|
# Set up a wacky binding with an escape.
|
||||||
sendline(r"function wacky_handler; echo Wacky Handler; end")
|
sendline(
|
||||||
|
r"""
|
||||||
|
function wacky_handler
|
||||||
|
set wacky_count (math $wacky_count + 1);
|
||||||
|
echo Wacky Handler $wacky_count
|
||||||
|
end
|
||||||
|
""".strip().replace(
|
||||||
|
"\n", os.linesep
|
||||||
|
)
|
||||||
|
)
|
||||||
expect_prompt()
|
expect_prompt()
|
||||||
|
|
||||||
sendline(r"bind abc\edef wacky_handler")
|
sendline(r"bind abc\edef wacky_handler")
|
||||||
|
@ -52,7 +63,7 @@ expect_prompt()
|
||||||
|
|
||||||
# Our wacky binding works.
|
# Our wacky binding works.
|
||||||
send("abc\x1bdef")
|
send("abc\x1bdef")
|
||||||
expect_str(r"Wacky Handler")
|
expect_str(r"Wacky Handler 1")
|
||||||
sendline(r"")
|
sendline(r"")
|
||||||
expect_prompt()
|
expect_prompt()
|
||||||
|
|
||||||
|
@ -64,7 +75,7 @@ os.kill(sp.spawn.pid, signal.SIGUSR1)
|
||||||
sleep(0.05)
|
sleep(0.05)
|
||||||
send("\x1bdef")
|
send("\x1bdef")
|
||||||
expect_str(r"Got SIGUSR1 2")
|
expect_str(r"Got SIGUSR1 2")
|
||||||
expect_str(r"Wacky Handler")
|
expect_str(r"Wacky Handler 2")
|
||||||
sendline(r"")
|
sendline(r"")
|
||||||
expect_prompt()
|
expect_prompt()
|
||||||
|
|
||||||
|
@ -76,6 +87,6 @@ os.kill(sp.spawn.pid, signal.SIGUSR1)
|
||||||
sleep(0.05)
|
sleep(0.05)
|
||||||
send("def")
|
send("def")
|
||||||
expect_str(r"Got SIGUSR1 3")
|
expect_str(r"Got SIGUSR1 3")
|
||||||
expect_str(r"Wacky Handler")
|
expect_str(r"Wacky Handler 3")
|
||||||
sendline(r"")
|
sendline(r"")
|
||||||
expect_prompt()
|
expect_prompt()
|
||||||
|
|
Loading…
Reference in a new issue