Conversation
EqualItemsHaveIndexedChanges_OnlyTheSpecifiedSlotChanges covers indexed list identity, which belongs to a separate issue rather than the strict filtering assertion correction. Remove the test along with the seed constant, test output constructor, and imports that existed solely to support it, restoring the list fixture to its previous state. The cache fixture retains only the strict Assert.Equivalent changes and their direct setup.
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.
Summary
The static
Filterregression tests for the cache asserted only on counts and on membership of the items that were expected to survive. That shape passes even when the operator leaves a stale entry behind: a result set containing an extra item that should have been filtered out satisfies "contains the expected items" just fine. The assertions were weak enough to hide exactly the class of bug they exist to catch.This change corrects the assertions to be exact rather than permissive. The result collections are now compared against the full expected set with
Assert.Equivalent(..., strict: true), so any leftover entry fails the test. The setup was also tightened so the comparison is meaningful: the threshold is derived from the generated data rather than from an average, which guarantees a known starting membership, and the mutations step through a partial exclusion and then a total exclusion so the strict comparison is exercised against both a non-empty and an empty expectation.Evidence
The assertion correction is backed by controlled mutation: each strengthened test was run against a deliberately broken operator that leaves a stale entry in place. Under the original assertions those mutants pass; under the corrected assertions they fail, and they pass again once the mutation is reverted. That confirms the new assertions are doing real work and are not merely more verbose restatements of the old ones.
Scope
Tests only, limited to
src/DynamicData.Tests/Cache/FilterFixture.Static.cs. No production code is touched by this PR.Fixes #1184