feat(complete): Add structured E2E completion test framework#6263
Draft
AndreasBackx wants to merge 1 commit intoclap-rs:masterfrom
Draft
feat(complete): Add structured E2E completion test framework#6263AndreasBackx wants to merge 1 commit intoclap-rs:masterfrom
AndreasBackx wants to merge 1 commit intoclap-rs:masterfrom
Conversation
Add a reusable `e2e_test!` macro and 20 test cases (5 per shell) that validate tab-completion end-to-end through real PTY sessions using the `exhaustive` example binary with dynamic-env completions. Shells covered: Bash, Fish, Zsh, Elvish. Scenarios covered per shell: subcommand completion, long option completion, option value completion, partial option value completion, and subcommand-scoped option completion.
Member
|
The PR description does not explain the goal of this extended coverage |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to #3166
Summary
Adds a reusable
e2e_test!macro and 20 PTY-based test cases (5 per shell: Bash, Fish, Zsh, Elvish) that validate tab-completion end-to-end using theexhaustiveexample binary with dynamic-env completions. Gated behindunstable-shell-tests+unstable-dynamic.I was trying to see what there was to actually test the real output of shells. But I couldn't really find much besides completest but it seemed like it was unused and documentation was hard to find. 😅️ What should be done to validate real output?
I already think some of this can be moved to snapshots instead of inline as well.
Test plan
cargo test -p clap_complete --features unstable-dynamic— no regressions--features unstable-dynamic,unstable-shell-tests -- e2e --list