Repository navigation
test: literal corpus × entry point against PostgreSQL (route B, step 3) - #135
Merged
Merged
Conversation
LiteralCorpusProbeTests asks the server pg_input_is_valid and the canonical text for about 4,500 generated literals over every range, multirange and value set type, and requires Parse, TryParse (string and span), JSON, the TypeConverter and the EF JSON document reader to agree with it, and the EF write-back (SQL constant, JSON document) to be the value the server reads. Registered in oracles.json with a seed, new claim J34, axes.md pair moved to "Varied by". Disagreements are candidates against #114, #115, #78 and the new Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 17, 2026
… probe Adds [x,infinity), (-infinity,x] and friends for the temporal range types and quoted or escaped whitespace bounds and elements. The infinity rows reproduce #117 on the literal and JSON-document paths and are registered against it; the whitespace rows catch the reverts of #45 and #70, so both seeds now name LiteralCorpusProbeTests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CaffeinatedCoder
force-pushed
the
test/literal-corpus-probe
branch
from
October 17, 2026 23:20
3affabe to
92a2b5e
Compare
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 #123
Problem
test/oracles/axes.mdlisted literal corpus × entry point against PostgreSQL on the same text as a pair no test varies.LiteralGrammarParityTestsasked the server about quoted, escaped and whitespace bounds, throughTryParseonly. Everything else PostgreSQL'srange_in,multirange_in,array_inand the element input functions tell apart had never been put to the server, and neither had the other entry points. #114 and #115 were single cells of this product. Each was found once and never kept as a test.Change
LiteralCorpusProbeTests(integration project, route B step 3 of Consumer probing: port TypeKit's prober tooling (route A), or BLite's lightweight way with hand-written axes and MSTest probe sweeps (route B) #105). It has one[DynamicData]row per type: 10 range types, their 10 multiranges and 28 value set types.YearMonthis left out because its literal isn't the text of thedaterangeit's stored as.emptyin every case, blank input, quoting, escapes, stray punctuation, trailing junk, ASCII and Unicode whitespace, array dimensions and NULLs, and multirange canonicalization. Per element kind it adds sign, leading zeros, exponent,NaN/Infinity, non-decimal integers and digit separators, more than 28 digits, overflow, the extremes,infinityspellings,epoch/now/today/allballs, non-ISO dates,24:00:00, the leap second, offsets and zone names, sub-microsecond digits, uuid spellings and NUL.pg_input_is_valid($1, type)and the canonical text, with every literal of a type sent as atext[]in one statement (a fallback runs one statement per literal). An array is read without its dimension decoration.Parse(string),Parse(span),TryParse(string),TryParse(span), JSON (a range or multirange as its literal; a value set as[E]where JSON can spell the element), theTypeConverterand the EF Core JSON document reader. All of them must agree. A value the library reads is also written back through EF Core as a SQL constant and as a JSON document, and the server compares it with the original as typed values. That comparison is what catches a precision the parser dropped.docs/serialization.mdnames (J07 strict ISO 8601, J06 thenumericgrammar), and an extreme the store spells±infinity(docs/efcore.md).CI=trueit fails. The whole class takes about 6 s.oracles.json, with the seedseeds/empty-keyword-matched-as-prefix.patch. New claim J34 quotes "The text is the PostgreSQL literal, the same text the server itself reads and prints". The class is added to theheldByof J06, J11, J12, J33 and S12. Inaxes.mdthe pair moves into "Varied by", and the two pairs it leaves open are listed.{type} {family}, each with an issue. No defect is fixed here.docs/oracles.md(route B) anddocs/testing.md.Findings
DecimalRange, its multirange,DecimalSetGuidSet,GuidSet<T>[x,infinity)loses the last day, and(-infinity,x]the first, on the literal and JSON-document paths too (scope added to the issue)DateRange,LocalDateRange, their multiranges0x/0o/0band1_000refused for integers[1:1]={…},[0:1]={…},{{}}refusedGuidSetfollowsGuid.Parse: accepts(…), refuses hyphen groupsLocalDateTimerefusesZand an offset thattimestampinput dropsDateTimeOffsetrefuses offsets beyond ±14:00(,max]raises 22003 in PostgreSQL and isn't in the boundary table (documentation)Int32Range,Int64RangetextelementI confirmed each one by hand against
postgres:17-alpinewithpsql(repros are in the issues). No24:00:00cell disagrees, so nothing is registered against #108: the library refuses24:00:00, and the server's value can't be aTimeOnly.Tests
dotnet test test/CodoMetis.ValueRanges.EFCore.PostgreSQL.IntegrationTestspasses with Docker: 200 tests in 11 s,LiteralCorpusProbeTestsincluded (49 tests, about 6 s).dotnet test test/CodoMetis.ValueRanges.Conventions.Testspasses (217 tests);Oracle*Testshold the registry, claims, seed and candidates.dotnet run tools/oracles.cs seedsgivesevery seed is caught: 48 (seed, oracle) pairs over both route B steps.LiteralCorpusProbeTestscatchesempty-keyword-matched-as-prefix(10 of 49 rows;LiteralGrammarParityTestsandRangeLiteralGrammarContractTestsstay green under it),quoted-bound-whitespace-kept(14) andtemporal-set-element-whitespace-kept(16).dotnet run tools/oracles.cs statusreports 0 oracles without a seed and 0 candidates without an issue.DecimalRangeandTimeRangecome only from that leg, so a leg that stopped comparing would fail ascandidate fixed.Bugs this sweep would have caught (retroactive check over every
bugissue)I added
found-by/oraclewhere it was missing and posted a comment naming the row and how it was verified:DateRange whitespace [" 2026-01-01",2026-01-02). I verified it by applyingseeds/quoted-bound-whitespace-kept.patch(the revert of fix: strip whitespace at either end of a quoted or escaped range bound #73): 14 of 49 rows fail.DateSet whitespace {" 2026-01-01"}. I verified it by applyingseeds/temporal-set-element-whitespace-kept.patch(the revert of fix: strip whitespace at either end of a quoted or escaped temporal set element #81): 16 of 49 rows fail.LiteralCorpusProbeTests.candidates.jsonrows are the proof. For A discrete range read as [x,infinity) loses 9999-12-31; UpperBound disagrees between memory and server #117 the catch is on the literal and JSON-document paths only; the column path isn't a cell of this sweep.Rebased onto main after route B step 2 (#125) merged; both steps' probe classes and seeds are kept.
🤖 Generated with Claude Code