Repository navigation
test: hand-written axes list and the JSON options probe sweep (route B, step 1) - #122
Merged
Merged
Conversation
…B, step 1) The first step of route B from #105: no tooling, a hand-written list of what a consumer varies and probe classes as ordinary MSTest sweeps over the product. - test/oracles/axes.md: one section per surface family of claims.json (literals and JSON; TypeConverter, configuration and web binding; EF Core; hosting and AOT), each axis with its values, the test that already varies it, and the pairs no test varies yet. - JsonOptionsProbeTests (conventions project): every discovered range, multirange and value set type, one [DynamicData] row each, x {union, sealed variant, interface, object, record property, dictionary value} x {default, camelCase, snake_case, ReferenceHandler.Preserve, a source-generated context, NumberHandling.AllowReadingFromString}. The oracle is the documented wire form and round trip, or the documented refusal. 13,560 checks in under a second; no disagreement found. - JsonOptionsProbeContext lists every type for the source-generated option set; a discovery test fails naming the attribute line to add when a type is missing. - Candidates.Verdict gains rowPrefix, so a per-row sweep scopes "candidate fixed" to its row. - OracleCatalogueTests requires a *ProbeTests class that holds a claim to be registered. - Registered in oracles.json; held claims J16, J18, J19, J21; seed interface-without-json-converter (IValueSet<T> without its [JsonConverter]), caught by JsonOptionsProbeTests and JsonDefaultContractTests. Co-Authored-By: Claude Fable 5.1 <[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 #121
Problem
The oracle machinery (#54) holds the library to its documents and lists what the API offers, but nothing varies the settings a consumer combines: the declared type of a property, the host's
JsonSerializerOptions, the culture, the entry point. #114, #116 and #117 were each found by one such combination, as a one-off probe that was not kept. #105 records two routes to consumer probing; this is the first step of route B (the BLite way): no tooling, a hand-written axes list and probe classes as ordinary MSTest sweeps.Change
test/oracles/axes.md(new, hand-written): one section per surface family ofclaims.json— literals and JSON; TypeConverter, configuration and web binding; EF Core; hosting and AOT. Each axis lists its values, the test that already varies it, and the pairs no test varies yet, which are the next probe classes (entry point × culture × type, where Minimal API binds a variant-typed parameter as null for a valid literal and answers 200 #116 is one cell; literal corpus × entry point againstpsql, where An inverted range literal parses as empty on every entry point; PostgreSQL rejects it #114 and Decimal text beyond 28 significant digits is rounded silently when a literal or JSON array is read #115 are cells).JsonOptionsProbeTests(conventions project, new): one[DynamicData]row per discovered range union, multirange and value set type (52 rows). Each row runs every value of the type × how it is declared {union, sealed variant,IRange<T>/ shape interface /IValueSet<T>,objectandList<object>, property of a record, dictionary value} ×JsonSerializerOptions{default, camelCase, snake_case,ReferenceHandler.Preserve, a source-generated context,NumberHandling.AllowReadingFromString}. The oracle is the document's promise: the wire form is the type's literal (a set's array), the round trip is the same value, a null property stays null, a read into an interface is the documentedNotSupportedException, and underAllowReadingFromStringevery number may arrive quoted. Disagreements are lines and end inCandidates.Verdict. 13,560 checks in about 400 ms.JsonOptionsProbeContext(new): the source-generated context listing every union, variant, multirange, set and element type. A discovery test fails naming the[JsonSerializable]line to add when a type is missing, since a context cannot discover types.Candidates.Verdictgains an optionalrowPrefix: a per-row sweep passes its row's label, so a candidate of another row is neither matched nor judged "fixed" there. Additive; every existing call is unchanged.OracleCatalogueTestsnow also requires a*ProbeTestsclass that holds a claim to be registered inoracles.json, so a probe cannot exist without a seed.oracles.json; added to theheldByof J16, J18, J19 and J21; seedinterface-without-json-converter.patch(drops the[JsonConverter]onIValueSet<T>, the pre-9.0.0 defect).docs/oracles.mdgets theaxes.mdsection, the probe-class rules and a "Write a probe" step;docs/testing.mdandtest/oracles/README.mdmention the probe sweeps. No consumer-facing document changed, so no claim quote moved.Tests
dotnet test test/CodoMetis.ValueRanges.Conventions.Tests: 164 passed (54 of them the new class).dotnet run tools/oracles.cs seeds interface-without-json-converter:CAUGHT → JsonOptionsProbeTests: 30 of 54 tests fail,CAUGHT → JsonDefaultContractTests: 1 of 5 tests fail.dotnet run tools/oracles.cs status: 30 oracles, 0 without a seed; the two unheld claims are still A02 and A03 (Native AOT, smoke-test only).dotnet buildof the whole solution is clean under warnings-as-errors.List<object>underReferenceHandler.Preservewrote{"$id":"1","$values":[…]}) is System.Text.Json's form for the list itself, not the value's, so it was a harness mistake and the check now reads the$valuesarray. No candidate was registered and no bug issue opened.🤖 Generated with Claude Code