test: only zsh pins the finite option values cli.md claims for every shell #220

Closed
opened 2026-09-08 02:29:04 +09:00 by natsukium · 0 comments
Owner

docs/reference/cli.md:494-496 now states that --format and sessions capture --source "complete to their listed values in every generated script, as they list them in --help and in the man page" — a claim spanning bash, zsh and fish.

The only test behind it, zsh_script_offers_the_finite_option_values (crates/felis-cli/src/cli_completions.rs:898), asserts three literals against script(Shell::Zsh) alone.

The claim is true today (bash emits COMPREPLY=($(compgen -W "visible scrollback command-output last-command"...)); fish emits -l source ... -r -f -a "visible..."; clap_mangen emits a "Possible values" block), so this is a coverage gap, not a wrong statement.

Failure mechanism: a later change that sets hide_possible_values, or a bash/fish overlay in cli_completions.rs that rewrites the --source/--format specs, leaves cli.md:494 false with every test still green, because nothing outside zsh is exercised.

Correction: the script(shell) helper is already parameterized — loop the assertion over [Shell::Bash, Shell::Zsh, Shell::Fish] with the per-shell candidate spelling for each, so the doc sentence and the test cover the same three shells.

Deferred from #187 because AC #2 explicitly scoped the required test to the zsh script plus --help; the doc wording is verified true today, so widening coverage is hardening beyond the acceptance criteria.

Split from #187.

`docs/reference/cli.md:494-496` now states that `--format` and `sessions capture --source` "complete to their listed values in every generated script, as they list them in `--help` and in the man page" — a claim spanning bash, zsh and fish. The only test behind it, `zsh_script_offers_the_finite_option_values` (`crates/felis-cli/src/cli_completions.rs:898`), asserts three literals against `script(Shell::Zsh)` alone. The claim is true today (bash emits `COMPREPLY=($(compgen -W "visible scrollback command-output last-command"...))`; fish emits `-l source ... -r -f -a "visible..."`; clap_mangen emits a "Possible values" block), so this is a coverage gap, not a wrong statement. Failure mechanism: a later change that sets `hide_possible_values`, or a bash/fish overlay in `cli_completions.rs` that rewrites the `--source`/`--format` specs, leaves `cli.md:494` false with every test still green, because nothing outside zsh is exercised. Correction: the `script(shell)` helper is already parameterized — loop the assertion over `[Shell::Bash, Shell::Zsh, Shell::Fish]` with the per-shell candidate spelling for each, so the doc sentence and the test cover the same three shells. Deferred from #187 because AC #2 explicitly scoped the required test to the zsh script plus `--help`; the doc wording is verified true today, so widening coverage is hardening beyond the acceptance criteria. Split from #187.
Sign in to join this conversation.
No description provided.