#1885·hydra

follow up with shell testing for #1842

Author: Jasha10Created Nov 11, 2021Updated Sep 27, 2026
Labelstests

Context

PR #1842 improved shell completion, but its tilde-prefixed override cases are only exercised in bash. The zsh and fish integration cases currently call xfail for any tilde-prefixed word, so they do not verify those shells' behavior.

The completion tests also need a more focused integration layer. tests/test_completion.py currently collects 216 shell-integration cases by running the same query matrix across bash, fish, and zsh, plus 400 cases for strip_python_or_app_name. Some inputs are duplicated. The direct _query tests are useful for the full completion matrix, but each shell session need not repeat it.

More importantly, the Expect scripts search for expected strings anywhere in the shell output. An expected word can match the echoed input command rather than a completion result: the bash harness accepts bogus for an input of bogus even when no completion is produced.

Work

  • Make the bash, zsh, and fish integration harnesses assert on actual completion output, not echoed input. Include a negative check that would have caught the false positive above.
  • Keep the detailed direct _query coverage, but reduce shell integration to representative end-to-end and shell-specific cases. Remove duplicate cases and simplify the oversized strip_python_or_app_name Cartesian product while retaining meaningful boundary coverage.
  • Investigate tilde-prefixed overrides in zsh and fish and replace the blanket xfail with tests of their actual supported behavior. If a shell form is inherently unsupported, make that limitation explicit instead of treating every tilde case as an expected failure.

The goal is trustworthy, proportionate coverage, not a broad completion rewrite. Change completion behavior only if the stronger tests reveal an in-scope defect.