Adds fix for chaining text prompt validations and tests#1973
Conversation
|
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 #1742
Changes
This PR updates
Validateoverloads onTextPromptExtensionsto short‑circuit based on the ValidationResult.Successful value in order to allow chaining of calls to theValidatemethod.Modified file: src/Spectre.Console/Prompts/TextPromptExtensions.cs — both
Validate<T>(Func<T,bool>, string?)andValidate<T>(Func<T,ValidationResult>)updated.Tests added: src/Spectre.Console.Tests/Prompts/TextPromptExtensionsTests.cs — verifies chaining, registration order, and short‑circuit behavior for both overloads.