Repository navigation
test: remove redundant and implementation-coupled coverage - #337
Merged
Merged
Conversation
Remove tests that require exact backing-array sizes, allocator capacities, buffer reuse thresholds, or inline policy storage from estimated_size(). The public APIs promise a memory estimate, not a stable layout or allocation strategy, so these assertions reject valid implementation changes. Keep behavior checks in the surrounding reset and capacity tests. Retain the deserialization regressions that bound memory growth after overfull input images; those detect unbounded resource use rather than a specific allocation size. Remove the padded policy fixture used only by the layout assertions. This change deletes 269 lines without adding replacement test machinery. Integration test targets compile successfully.
Remove repeated numeric and string scenarios for the same generic update and merge implementation, redundant one-item and derived-row equality checks, and the separate growth test module. Existing exact-mode updates, borrowed-string updates, merges, and serialization round trips already exercise those behaviors. Retain the colliding non-Clone key regression as one update test that checks total stream weight and frequency bounds against the input counts. Do not pin the purge median, exact retained key count, or byte-for-byte stability after an otherwise equivalent round trip. Keep ownership, overflow, empty-state, and distinct serialization codecs covered. The frequencies integration tests pass. A temporary mutation that writes incorrect rehash probe distances still fails the simplified collision test, demonstrating that the public-contract assertions detect the original regression risk. This commit removes 324 net lines.
…yout Remove fixed serialized checksums, stable tie-order expectations, and tests that locate a particular merged centroid by decoding output bytes. These assertions freeze compression choices that are not part of the public contract and make valid algorithm changes look like regressions. Keep mixed compressed and buffered collection coverage using total weight, extrema, and median accuracy. Consolidate large-weight rounding cases into monotonic, finite-range quantile and CDF checks with nonnegative PMF mass instead of requiring particular rounded center values. Drop scalar interpolation scenarios already exercised by the existing scalar-and-batch reference tests. Retain cross-language snapshots, malformed-image rejection, overflow checks, signed-zero query semantics, extreme-value regressions, and the documented unchanged result for collecting a single nonempty input. No production implementation changes. cargo x check, cargo x test, and cargo x lint pass.
Remove REQ sorted-view unit tests that repeat existing public empty-state and distribution-query coverage. Exercise both direct sketch rank and sorted-view rank against the same exact-mode reference values in the integration test. Remove shared-reference smoke tests and a four-thread read smoke test that add no behavior coverage beyond the existing immutable calls and Send + Sync assertions. Keep owned-snapshot and argument-validation contracts. Check iterator weights by their sum and item range instead of prescribing power-of-two compaction levels. Remove Count-Min single-key and repeated-update scenarios already covered by update-and-bounds and halving tests. The Count-Min numeric overflow and precision regressions remain. cargo x check, cargo x test, and cargo x lint pass.
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.
The test suite currently treats specific allocation sizes, centroid layouts, and floating-point rounding choices as stable behavior, and repeats several scenarios across equivalent generic instantiations. This change removes those constraints and consolidates coverage around observable contracts. Production behavior is unchanged.
Changes
estimated_size()byte counts, allocator-capacity and buffer-reuse expectations, and fixtures used only to inspect inline policy storage. These APIs provide implementation-dependent estimates. Keep the overfull-deserialization regressions that detect unbounded memory growth.Cross-language fixtures, malformed-input rejection, overflow handling, distinct serialization codecs, error bounds, and public numerical-stability regressions remain covered. No new test framework or shared fixture layer is introduced. This tests-only change does not require a changelog entry.
Size
22 files changed: 72 lines added, 1,330 removed; net reduction of 1,258 lines. There are 57 fewer test functions.
Validation
cargo x prepare-testdatacargo x checkcargo x testcargo x lintAll commands pass. A temporary mutation that writes incorrect frequencies rehash probe distances still fails the simplified collision test at the public frequency-bound assertion; the original implementation was restored before the full checks.