Repository navigation
test: entry point × culture × type probe sweeps (route B, step 2) - #125
Merged
Merged
Conversation
CultureEntryPointProbeTests (conventions) reads and writes every discovered range, multirange and set type, as union and sealed variant, through Parse, TryParse, TypeDescriptor, configuration binding, JSON and interpolation under de-DE, sv-SE, fa-IR and th-TH as the current culture, against the invariant culture's reading. HostCultureProbeTests (AspNetCore) binds every type from a query, nullable query, route value, form field and JSON body through MVC and a minimal API under four request cultures set by RequestLocalization. Both are registered in oracles.json, named in the heldBy of J04, J05, J13, J15, J16 and J32, and seeded with parser-reads-the-current-culture. The only disagreement is #116, measured wider than filed: every variant-typed minimal-API parameter bound through TryParse answers 200 with null, for the right shape and another shape alike; registered as one candidate per range type. axes.md moves the four pairs into "Varied by". Closes #124 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 #124
Problem
test/oracles/axes.mdlisted four pairs that no test varied. The literal is a wire format with no culture (J04, J05, J13, J16), but the existing culture sweeps each held only part of that:LiteralCultureContractTestsvaries the current culture forToStringonly.LiteralProviderContractTestsvaries the provider handed toParse, and leaves the current culture as the machine set it.So a parser that read
CultureInfo.CurrentCultureitself passed on any CI machine set to the invariant culture. #116 was one cell of the missing product, found once and not kept.Change
CultureEntryPointProbeTests(conventions project): one[DynamicData]row per discovered type (52 rows). Each type is tried as the union and as the sealed variant, through 12 read and 5 write entry points that need no host, under de-DE, sv-SE, fa-IR and th-TH as the current culture:ParseandTryParse, string and span, with a null provider and with the current cultureTypeDescriptorfrom and to text, with a null and the current cultureIConfigurationbindingstring.FormatThe reference is read and written under the invariant culture before any culture is switched. The project gains
Microsoft.Extensions.Configurationand.Binder(10.0.12).HostCultureProbeTests(AspNetCore project): oneTestServerserving 107 declared types (every union, its 5 variants, everyRangeSet, every set type). Each type has a minimal-API route group and a closedProbeController<T>. Each is bound from a query, a nullable query, a route value, a form field and a JSON body, under four request cultures set byUseRequestLocalization.RangeProbes,SetProbes,WrapperElements,ReflectandCandidates.cs.SetProbes' twocrefs became<c>so the file compiles in both projects.Oracle machinery:
oracles.jsonand added to theheldByof J04, J05, J13, J15, J16 and J32.parser-reads-the-current-culture.patch.axes.mdmoves entry point × culture × type, current culture × JSON, host × request culture, configuration × every type and host × variant-typed parameter into "Varied by".docs/oracles.md(route B) anddocs/testing.md, and a line inAGENTS.md(AspNetCore project).Finding: only Minimal API binds a variant-typed parameter as null for a valid literal and answers 200 #116, measured wider than filed (comment on Minimal API binds a variant-typed parameter as null for a valid literal and answers 200 #116). Every variant of every range type, bound by a minimal API through
TryParsefrom a query, nullable query, route value or form field, answers 200 withnull, for the right shape and for another shape alike. That is 160 requests per range type. It is registered as 11 candidates (one per range type, row<Type> variant minimal TryParse), scoped so the JSON-body and MVC cells of the same variants stay held. No defect is fixed here.Tests
dotnet testis green in all eight projects, integration included (Docker on).Rows run: 52 + 52, plus a discovery floor in each class. The conventions sweep makes ~10,300 checks in 0.3 s; the host sweep sends ~12,400 requests in ~3 s.
dotnet run tools/oracles.cs seeds parser-reads-the-current-culture:CAUGHT → CultureEntryPointProbeTests: 10 of 53 tests failCAUGHT → HostCultureProbeTests: 10 of 53 tests failThe failures are for the defect:
-1.5is refused under de-DE, and the host answers 400 to a valid literal.dotnet run tools/oracles.cs status: 32 oracles, 33 seeds, none without a seed; 25 candidates, none without an issue. Only the two AOT claims A02 and A03 are unheld, as before this PR.Expect a rebase against route B step 3 (the literal corpus × entry point sweep), which also touches
oracles.json,claims.json,docs/oracles.mdanddocs/testing.md.Bug issues this sweep would have caught
I went through all 16 issues labelled
bug, open and closed, and checked each against the two probe classes.HostCultureProbeTests. Example row:Int32Range variant minimal TryParse query as Int32Range.Finiteanswers 200 with null. I verified it by running the sweep on main at 3ecfa10, where the defect is unfixed, before registering the candidates. I commented on the issue. Theoracle/would-catchlabel is not applied yet: it does not exist in the repository (the GitHub API returns 404).SECURITY.md. None of these depend on the culture or on how a host binds, and the inputs here are well-formed literals of values that round-trip. I have not labelled them, as instructed.🤖 Generated with Claude Code