Repository navigation
fix: reject a negative or repeated Within timeout like core does - #160
Merged
Merged
Conversation
vbreuss
commented
Oct 9, 2026
Member
- A negative Within(...) timeout now throws ArgumentOutOfRangeException ("The timeout must not be negative.") when the expectation is built, instead of an unrelated CancelAfter error during evaluation. Timeout.InfiniteTimeSpan is still allowed.
- Calling Within(...) a second time now throws InvalidOperationException ("Within cannot be specified more than once.") instead of silently replacing the first timeout.
- Messages and check order match aweXpect core's own Within options; regression tests are added.
A negative timeout only failed later with an unrelated `CancelAfter` error, and a second `Within` silently replaced the first one. - A negative timeout throws `ArgumentOutOfRangeException` when the expectation is built; `Timeout.InfiniteTimeSpan` is still allowed. - A second `Within` throws `InvalidOperationException`, with the same wording as core.
vbreuss
force-pushed
the
fix/within-option-validation
branch
from
October 9, 2026 16:28
d79437d to
ac1867d
Compare
👽 Mutation ResultsaweXpect.MockolateDetails
The final mutation score is 90.00%Coverage Thresholds: high:80 low:60 break:0 |
🚀 Benchmark ResultsDetails
|
vbreuss
enabled auto-merge (squash)
October 9, 2026 16:31
|
|
This is addressed in release v3.3.0. |
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.


