mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-06-02 05:41:16 -03:00
Move complete test to pexpect
This commit is contained in:
20
tests/pexpects/complete.py
Normal file
20
tests/pexpects/complete.py
Normal 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")
|
||||
Reference in New Issue
Block a user