Skip to content

Commit 7b04391

Browse files
author
yoshibase
committed
fix(completion): harden bash COMP_WORDBREAKS handling and test
Make the compspec tolerate unset COMP_WORDBREAKS and helper failures, and drive the integration test through the same Python entrypoint as other completion tests so the autocomplete env var matches.
1 parent ce3f524 commit 7b04391

1 file changed

Lines changed: 0 additions & 3 deletions

File tree

tests/test_completion/test_completion_bash_wordbreaks.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ def _bash_completion_reply(
2626
if bash is None:
2727
raise RuntimeError("bash not found")
2828

29-
# Call Python the same way other completion tests do, so the autocomplete
30-
# env var matches --show-completion. Avoid PATH wrappers that change argv[0].
3129
with tempfile.NamedTemporaryFile("w", suffix=".sh", delete=False) as handle:
3230
handle.write(
3331
f"""
@@ -107,7 +105,6 @@ def test_bash_completion_script_handles_comp_wordbreaks_colon() -> None:
107105
reply = _bash_completion_reply(
108106
python_cmd=python_cmd,
109107
complete_var=complete_var,
110-
# COMP_LINE keeps the full token; bash would have split on ':' in COMP_WORDS.
111108
comp_line="colon_example.py --name alpine:l",
112109
)
113110
assert "latest" in reply.splitlines()

0 commit comments

Comments
 (0)