Repository navigation
test: count range unions by structure, so a stale floor cannot hide a missing one - #229
Merged
Merged
Conversation
… missing one The range sweeps asserted "at least 11" discovered unions, a count from before the float family made it 13, so both float unions could drop out of discovery (a broken IRangeFactory<,> or IRange<> declaration) and the sweeps would still pass. RangeCensus counts unions by what they are: a top-level abstract type nesting a sealed variant that implements IEmptyRange<T>. Each sweep now asserts that it reached every union of the census, naming any it missed, with a floor only against the census finding nothing (both assemblies hold a union). ClosedUnionContractTests, RangeOrderParityTests and DifferentialFuzzParityTests (named in the issue), plus the same stale floor in CapturedCollectionProbeTests and JsonDefaultContractTests, and a census check beside MappingParityTests' per-assembly floors. Dropping Float64Range from RangeProbes, or Float32Range from FuzzTypes, fails each of them, naming the union. Closes #222 Co-Authored-By: Claude Opus 5.5 <[email protected]>
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.
Closes #222
Problem
ClosedUnionContractTests.KnownUnions,RangeOrderParityTestsandDifferentialFuzzParityTestsasserted at least 11 discovered range unions. There have been 13 since the float family, 9 core and 4 NodaTime. So both float unions could drop out of discovery and the closed-union, order and fuzz sweeps would still pass. The same stale11was also inCapturedCollectionProbeTestsandJsonDefaultContractTests.Change
RangeCensus(conventions project, linked into the integration project likeRangeProbes) counts unions by structure: a top-level abstract type that nests a sealed variant implementingIEmptyRange<T>. It does not use theIRangeFactory<,>orIRange<>interface the sweeps discover by, so a union that lost its interface still counts.AssertReachedEveryUnion(reached, sweep)fails and names every union a sweep did not reach. The only fixed floor guards against the census finding nothing: both the core and the NodaTime assembly must hold a union. A new range type needs no edit.CapturedCollectionProbeTests.Ranges_AnswerAsInMemory,JsonDefaultContractTests.Discovery_FindsEveryRangeAndSetType), now call it instead of the count.MappingParityTestskeeps its per-assembly floors, which were already current, and adds the census check.docs/architecture.md(the add-a-type procedure) anddocs/testing.mddescribe the census.Tests
Float64RangefromRangeProbes.AllRangeTypesandFloat32RangefromFuzzTypes.Ranges, each by name in the discovery filter. Every test failed with its sweep's name, for exampleEveryUnion_RefusesAnEmittedSubtype_AndStillCopiesItsOwnVariants did not reach 1 of the 13 range unions: Float64Range., and the same forEveryRangeAndMultirange_OrdersAsPostgresandRanges_AgreeWithPostgres. The filters were then reverted. These are test-side drops, so nosrc/seed exists for them. Removing the interface from a union does not compile.Not changed here: the
knownRowsfloors (CultureEntryPointProbeTests,JsonOptionsProbeTests,LiteralEntryPointParityTests: 52;LiteralCorpusProbeTests: 48). They count rows over ranges and sets, so they may be stale the same way. They stay "at least" floors, and the census does not cover the set side.🤖 Generated with Claude Code