Case insensitive user text input comparison#1960
Case insensitive user text input comparison#1960akinsmosu wants to merge 8 commits intospectreconsole:mainfrom
Conversation
@microsoft-github-policy-service agree |
patriksvensson
left a comment
There was a problem hiding this comment.
Great first PR, but there are some changes I would like to see before I merge this 👍
Co-authored-by: Patrik Svensson <patriksvensson@users.noreply.github.com>
Co-authored-by: Patrik Svensson <patriksvensson@users.noreply.github.com>
Co-authored-by: Patrik Svensson <patriksvensson@users.noreply.github.com>
Co-authored-by: Patrik Svensson <patriksvensson@users.noreply.github.com>
|
Thanks for the feedback! All suggestions applied. |
|
Hi! Thanks so much for taking the time to submit this PR. Unfortunately, I haven’t had the capacity to review this in a timely manner, and since it was opened, the repository has changed significantly. Because of that, this PR is no longer in a state where it can be reviewed or merged as-is. This is not your fault, but mine, and I'm sorry about this. I’m going to close it for now to help keep things tidy. That said, if you’re still interested in contributing, please feel free to open a new pull request that’s up to date with the current state of the repository, and I’ll be happy to take a look when I can. I'll promise I'll do better this time around. Thanks again for your work and for your interest in the project! |
fixes #1906
Changes
Summary
This PR makes
TextPrompt<string>case-insensitive when matching user input against defined choices. Previously, inputs such as"yes"would fail to match"Yes".What this change does
When the
TextPrompt's generic is a string and the user did not explicitly provide a comparer, it automatically configures_comparertoStringComparer.OrdinalIgnoreCase.Adds a theory-based test to verify case-insensitive matching.
All existing behavior remains unchanged for non-string
TextPrompt<T>usage.Implementation Notes
Added a
typeof(T) == typeof(string)check inTextPrompt<T>to detect string-based prompts._compareris set toStringComparison.OrdinalIgnoreCaseonly if the user does not supply a comparer.