Add a test for COMPLETE_AUTO_SPACE

Improves our test coverage a bit.
This commit is contained in:
ridiculousfish 2022-06-02 17:25:36 -07:00
parent 8ff07d46c2
commit 52cfb66cf7

View file

@ -2,15 +2,36 @@
from pexpect_helper import SpawnedProc
sp = SpawnedProc()
send, sendline, sleep, expect_prompt, expect_re = (
send, sendline, sleep, expect_prompt, expect_re, expect_str = (
sp.send,
sp.sendline,
sp.sleep,
sp.expect_prompt,
sp.expect_re,
sp.expect_str,
)
expect_prompt()
# Verify COMPLETE_AUTO_SPACE behavior
sendline("complete -x -c monster -a truck")
expect_prompt()
sendline("complete -x -c monster -a energy=")
expect_prompt()
send("monster t")
sleep(0.1)
send("\t")
sleep(0.1)
send("!")
expect_str("monster truck !") # space
send("\b" * 64)
send("monster e")
sleep(0.1)
send("\t")
sleep(0.1)
send("!")
expect_str("monster energy=!") # no space
send("\b" * 64)
sendline(
"""
# Make sure this function does nothing