Validate shell completion across supported shells
This commit is contained in:
14
internal/cobra/testdata/completion_terminal.py
vendored
14
internal/cobra/testdata/completion_terminal.py
vendored
@@ -39,7 +39,17 @@ try:
|
||||
child.expect_exact("PROMPT> ")
|
||||
child.send(line)
|
||||
child.send("\t")
|
||||
child.sendline("")
|
||||
child.expect_exact("PROMPT> ")
|
||||
if os.environ.get("PROBE_LIST") == "1":
|
||||
child.send("\t")
|
||||
remaining = ["Readable text", "YAML output"]
|
||||
captured = []
|
||||
while remaining:
|
||||
index = child.expect_exact(remaining)
|
||||
captured.append(child.before + child.after)
|
||||
remaining.pop(index)
|
||||
print("".join(captured))
|
||||
else:
|
||||
child.sendline("")
|
||||
child.expect_exact("PROMPT> ")
|
||||
finally:
|
||||
child.close(force=True)
|
||||
|
||||
Reference in New Issue
Block a user