diff options
Diffstat (limited to 'internal/calendar/coverage_test.go')
| -rw-r--r-- | internal/calendar/coverage_test.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/internal/calendar/coverage_test.go b/internal/calendar/coverage_test.go index e6555b9..cbd3fde 100644 --- a/internal/calendar/coverage_test.go +++ b/internal/calendar/coverage_test.go @@ -52,6 +52,25 @@ func TestEFCoverage(t *testing.T) { } } +// TestOFOrdinaryTimeFerialWeek guards the post-Pentecost Ordinary-Time ferial +// week numbering, which was one too high (a weekday took Christ-the-King's week +// instead of its preceding Sunday's). calapi confirms these canonical weeks. +func TestOFOrdinaryTimeFerialWeek(t *testing.T) { + sel := calendar.DefaultSelection() + layers := []calendar.Layer{caldata.Universal()} + for _, c := range []struct { + date time.Time + slug string + }{ + {day(2026, time.June, 8), "ordinary-10-mon"}, // calapi: 10th week + {day(2026, time.June, 15), "ordinary-11-mon"}, // calapi: 11th week + } { + if got := calendar.Compute(c.date, sel, layers); got.Observed.Slug != c.slug { + t.Errorf("%s: OT ferial slug %q, want %q", c.date.Format("2006-01-02"), got.Observed.Slug, c.slug) + } + } +} + // TestOFMovableMemorials checks Mary, Mother of the Church, the Immaculate Heart, // and the two-obligatory-memorials rule. func TestOFMovableMemorials(t *testing.T) { |
