Move complete test to pexpect

This commit is contained in:
Fabian Homborg
2020-06-08 17:16:09 +02:00
parent 927aa60349
commit 9d523c7589
3 changed files with 12 additions and 12 deletions

View File

@@ -0,0 +1,20 @@
#!/usr/bin/env python3
from pexpect_helper import SpawnedProc
sp = SpawnedProc()
send, sendline, sleep, expect_prompt, expect_re = sp.send, sp.sendline, sp.sleep, sp.expect_prompt, sp.expect_re
expect_prompt()
sendline("""
complete -c my_is -n 'test (count (commandline -opc)) = 1' -xa arg
complete -c my_is -n '__fish_seen_subcommand_from not' -xa '(
set -l cmd (commandline -opc) (commandline -ct)
set cmd (string join " " my_is $cmd[3..-1])" "
commandline --replace --current-process $cmd
complete -C"$cmd"
)'
""")
send("my_is not \t")
send("still.alive")
expect_re(".*still.alive")