aboutsummaryrefslogtreecommitdiff
path: root/internal/calendar/coverage_test.go
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-07-28 09:30:22 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-07-28 09:30:22 +0200
commit6641ce335de522e6d51c47ad9d14f69726650592 (patch)
treeff56e36d12b46698bd41a26e650df99436ed3f22 /internal/calendar/coverage_test.go
parent70b805018f0ae0d8424c3c7de8f1169476385a35 (diff)
downloadlectio-6641ce335de522e6d51c47ad9d14f69726650592.tar.gz
lectio-6641ce335de522e6d51c47ad9d14f69726650592.zip
fix(of): canonical OT ferial week numbering + CR-sourced ferial lectionary
The Ordinary Form ferial lectionary had two linked defects, both from harvesting niedziela.pl by date: (1) post-Pentecost Ordinary-Time ferial WEEK NUMBERS were one too high (temporal.go counted back from Christ the King using the weekday itself, not its preceding Sunday, so a ferial took the next week's number), and (2) ~17 ferial keys held a SAINT's readings (stored when a saint displaced the ferial on the queried date, e.g. week 22 smeared with a Marian Prov 8/John 2), plus 16 weekday slots were missing entirely. - temporal.go: number a span-2 ferial from its preceding Sunday. Verified 388/388 ferial-week agreement with calapi across 2026-2028. - scripts/genlect-of-cr.py: regenerate the Ordinary-Time ferial lectionary (first/psalm/gospel, both years, all 34 weeks) from catholic-resources.org (Fr. Felix Just, S.J.), which is keyed by liturgical position (immune to by-date contamination) and complete. Citations only; text still rendered from the public-domain corpora. of-lectionary.ini OT ferials now 408 (was 392). Fixes ~17 contaminated entries + 16 gaps + the week-numbering audit item. Psalms already share modern numbering, so no conversion. Adds TestOFOrdinaryTimeFerialWeek. Credits catholic-resources.org in NOTICE. Bumps to 0.40.0.
Diffstat (limited to 'internal/calendar/coverage_test.go')
-rw-r--r--internal/calendar/coverage_test.go19
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) {