fish-shell/tests/pexpects/complete.py
Fabian Homborg 10fbdd34e7 Reformat pexpects
These are now python scripts
2020-06-08 17:33:04 +02:00

29 lines
636 B
Python

#!/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")