test(complete): Add tests for delimited value edge cases#6265
Draft
AndreasBackx wants to merge 1 commit intoclap-rs:masterfrom
Draft
test(complete): Add tests for delimited value edge cases#6265AndreasBackx wants to merge 1 commit intoclap-rs:masterfrom
AndreasBackx wants to merge 1 commit intoclap-rs:masterfrom
Conversation
b2588bd to
7da02ad
Compare
epage
reviewed
Feb 13, 2026
| } | ||
|
|
||
| #[test] | ||
| fn suggest_delimiter_with_allow_hyphen() { |
Member
There was a problem hiding this comment.
If this is extra tests for value_delimiter, why is it not next to that?
epage
reviewed
Feb 13, 2026
Comment on lines
+1484
to
+1485
| #[test] | ||
| fn suggest_delimiter_positional_multi() { |
Member
There was a problem hiding this comment.
What in particular is the concern this is trying to address?
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 #3922
Summary
Adds regression test coverage for delimiter-separated value completion edge cases. These tests confirm the existing implementation already handles these scenarios correctly — no code changes were needed.
Tests added
suggest_delimiter_with_allow_hyphen— Verifiesvalue_delimiter+allow_hyphen_values(true)works correctly: hyphen-prefixed values like--specialand-scomplete properly both as first values and after a delimiter.suggest_delimiter_positional_multi— Verifies multiple positional arguments each with their ownvalue_delimitercomplete independently.Note
Issue #3922 tracks broader delimiter edge cases. The specific scenarios tested here already work.
This PR adds coverage to prevent regressions as other delimiter-related work lands.
Test plan
cargo test -p clap_complete --features unstable-dynamic— all 109 tests passcargo clippy -p clap_complete --features unstable-dynamic— clean