Repository navigation
tests: a second seed for the calendar factories' refusals, and a join case for E76 #451
Description
Found by a review of #191 (main PR #447 @ 879c82a, release/10.x PR #449 @ 684216b), checked on PostgreSQL 16.15 and 18.1.
Problem
-
The one seed proves only the extremes half of
CalendarFactoryParityTests.calendar-last-period-ends-on-a-day-not-infinity.patchbreaks the last period's constant. Nothing proves the refusal half,CalendarFactories_OverAnArgumentMemoryRefuses_RaiseInPostgres, which is the half most likely to go vacuous: it accepts three SQLSTATEs, and its Where form passes if any row raises. A second seed inMondayOf(ValueRangesMethodCallTranslator.cs) shows the class is real and is caught by that test alone:- sqlExpressionFactory.LessThanOrEqual(week, weeks) + sqlExpressionFactory.LessThanOrEqual(week, sqlExpressionFactory.Add(weeks, Int(1)))
With it, week 53 of a 52-week year rolls over to the next year's week 1. On
main@ 7503c18, PostgreSQL 16:Failed CalendarFactories_OverAnArgumentMemoryRefuses_RaiseInPostgres IsoWeek(2025, 53) Select: the server answered, where memory throws IsoWeek(2025, 53) Where: the server answered, where memory throws Failed: 1, Passed: 2The class's other two tests pass with the seed.
-
"Filter, join and sort by it" isn't held for the join.
docs/efcore.md#what-runs-whereclaims a join (quoted by E76), but neither E76's claim nor any test covers one. It works: a join onDateRange.Month(x.Day) == DateRange.Month(y.Y, m)over both extremes gives the 1,365 rows memory gives. So this is a gap, not a bug. -
Cosmetic: the seed patch repeats its
diff --githeader line, the only seed intest/oracles/seeds/that does.git applyaccepts it.
Change
- Add the seed above as
test/oracles/seeds/calendar-iso-week-53-of-a-52-week-year-rolls-over.patch, withOracles: CalendarFactoryParityTests. Then rundotnet run tools/oracles.cs seeds calendaron both lines. - Add a join case to
CalendarFactoryParityTeststhat compares with memory at both extremes, and add "a join" to E76's claim. Or drop "join" from the doc. - Remove the duplicate header line from the existing seed.
Test
The new seed fails CalendarFactories_OverAnArgumentMemoryRefuses_RaiseInPostgres and nothing else. That is the proof verify-the-guard asks for.
Activity
CaffeinatedCoder commentedon Oct 25, 2026
Fixed in #456 (
main, stacked on #455) and #459 (release/10.x, stacked on #458). The new seed failsCalendarFactories_OverAnArgumentMemoryRefuses_RaiseInPostgresalone. The new join test (Month,QuarterandYear, a date form against an integer form, with the extremes required to find a partner) is also caught by the existing seed, whoseFails:line now says so.dotnet run tools/oracles.cs seeds calendarreportsevery seed is caughton both lines. Close by hand once both merge.Merge pull request #459 from CaffeinatedCoder/test/451-calendar-seed-…
CaffeinatedCoder commentedon Oct 25, 2026
Merged on both lines; #459 was the
release/10.xPR. Closed by hand, sinceClosesacts only onmain.Merge pull request #456 from CaffeinatedCoder/test/451-calendar-seed-…