feat: add IgnoringInterspersedItems option for collections#646
Merged
Conversation
With this option enabled additional items between the expected items are skipped and do not result in a failure.
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a new IgnoringInterspersedItems option for collection matchers, allowing expected items to be matched in order while skipping any extra items between them. Key changes include:
- API extensions to expose
IgnoringInterspersedItems()on expectation/result builders. - Core logic updates in
CollectionMatchOptionsand variousCollectionMatcherimplementations to honor interspersed-item skipping. - Extensive updates to existing tests to adjust error messages when all expected items are missing.
Reviewed Changes
Copilot reviewed 20 out of 21 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| Source/aweXpect.Core/Options/CollectionMatchOptions.cs | Added _ignoringInterspersedItems flag, extended matcher selection and expectation formatting. |
| Source/aweXpect.Core/Options/*CollectionMatcher.cs | Updated same‐order matchers to support interspersed-item skipping with a new parameter and tracking. |
| Source/aweXpect/Results/*CollectionMatchResult.cs | Added IgnoringInterspersedItems() methods and XML docs. |
| Source/aweXpect.Core/Core/Helpers/ExceptionHelpers.cs | Introduced IsDefault<T> extension for detecting default struct values. |
| Tests/aweXpect.Tests/Collections/** | Updated expected exception messages in dozens of tests to reflect the new phrasing. |
| Tests/aweXpect.Core.Api.Tests/Expected/** and Tests/aweXpect.Api.Tests/Expected/** | Added IgnoringInterspersedItems() to API expectation snapshots. |
| Pipeline/Build.cs | Changed BuildScope from Default to CoreOnly. |
Comments suppressed due to low confidence (1)
Pipeline/Build.cs:22
- [nitpick] Switching the build scope to
CoreOnlymay prevent packaging or publishing other components. Please verify this change is intentional and update the comment to reflect the narrower scope.
readonly BuildScope BuildScope = BuildScope.CoreOnly;
|
Contributor
Test Results 4 files 4 suites 22s ⏱️ Results for commit 375f3e8. |
Contributor
|
This is addressed in release v2.17.0. |
This was referenced Sep 1, 2025
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.

This PR introduces a new
IgnoringInterspersedItemsoption for collection matchers, allowing expected items to be matched in order while skipping any extra items between them. Key changes include:IgnoringInterspersedItems()on expectation/result builders.CollectionMatchOptionsand variousCollectionMatcherimplementations to honor interspersed-item skipping.