diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-07-28 10:20:23 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-07-28 10:20:23 +0200 |
| commit | a92bb734f2a1780431fd2fbab65aa814200397f7 (patch) | |
| tree | 47979d6ad701f245b916b087bd561b441cfac2b2 /internal/caldata/of_test.go | |
| parent | 97f704b659ea6c72c4aa354378b347283ecc5cac (diff) | |
| download | lectio-a92bb734f2a1780431fd2fbab65aa814200397f7.tar.gz lectio-a92bb734f2a1780431fd2fbab65aa814200397f7.zip | |
feat(of): complete Sunday lectionary from catholic-resources.org (restore 2nd readings)
The niedziela harvest had dropped the SECOND reading on 271 of ~299 Sunday-cycle
entries (a Sunday Mass is first/psalm/second/gospel). scripts/genlect-of-sundays-cr.py
re-sources the temporal Sunday & solemnity lectionary (Ordinary Time, Advent,
Christmas, Lent, Easter, Trinity, Corpus Christi, Sacred Heart, Christ the King;
all three cycles A/B/C) from catholic-resources.org, keyed by liturgical position,
and merges the complete readings into of-lectionary.ini.
- Also corrects ~6 contaminated Sunday first readings the niedziela by-date
harvest had picked up (ordinary-sunday-21-B had a Marian Prov 8; advent-2-A had
the Immaculate Conception's Gen 3; Christ the King B/C, Trinity C, Pentecost,
Ascension/7th-of-Easter were wrong).
- Content-validated: every changed first reading verified against the old one
(all changes are correct fixes or the identical passage, book spelling aside).
- Handles source quirks: hyphen/en-dash/ABC cycle markers, verbose Year-A
solemnity names, 'opt:' cycle-proper alternates, '[2025: Corpus Christi]'
displacement notes appended to names, Palm Sunday (cycle-independent
first/second, per-cycle Passion gospel kept), and abbreviation variants
(Jon/Is/Mt/Act/Zac...).
157/157 Sundays render first+psalm+second+gospel across 2026-2028. Adds
TestOFSundayCompleteReadings, credits the source in NOTICE, bumps to 0.42.0.
Diffstat (limited to 'internal/caldata/of_test.go')
| -rw-r--r-- | internal/caldata/of_test.go | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/internal/caldata/of_test.go b/internal/caldata/of_test.go index 26a3695..91c9b59 100644 --- a/internal/caldata/of_test.go +++ b/internal/caldata/of_test.go @@ -24,10 +24,11 @@ func TestOFReadingsByCycle(t *testing.T) { } } // The gospel of Christ the King (cycle A) is Matthew 25:31-46. The citation - // may spell Matthew as "Mat" (niedziela/ToEnglishRef) or "Matt" (seed); both - // resolve to Matthew via books.ini. - if !strings.HasPrefix(gospel, "Mat 25") && !strings.HasPrefix(gospel, "Matt 25") { - t.Fatalf("christ-the-king-A gospel = %q, want Matthew 25…", gospel) + // may spell Matthew as "Mat"/"Matt" (niedziela/ToEnglishRef) or "Matthew" + // (catholic-resources.org); all resolve to Matthew via books.ini. + if !strings.Contains(gospel, "25:31-46") || + !(strings.HasPrefix(gospel, "Mat 25") || strings.HasPrefix(gospel, "Matt 25") || strings.HasPrefix(gospel, "Matthew 25")) { + t.Fatalf("christ-the-king-A gospel = %q, want Matthew 25:31-46", gospel) } } @@ -63,3 +64,24 @@ func TestOFWeekdayEmpty(t *testing.T) { t.Fatalf("weekday should be empty, got %v", rs) } } + +func TestOFSundayCompleteReadings(t *testing.T) { + // Every OF Sunday/solemnity Mass has a SECOND reading; the niedziela harvest + // had dropped it on 271 entries, restored from catholic-resources.org. + for _, tc := range []struct{ slug, cycle string }{ + {"ordinary-sunday-11", "A"}, {"trinity-sunday", "A"}, + {"palm-sunday", "B"}, {"pentecost", "C"}, + } { + day := calendar.LiturgicalDay{ + Observed: calendar.Celebration{Slug: tc.slug, Layer: "temporal"}, + SundayCycle: tc.cycle, Weekday: time.Sunday, + } + parts := map[string]bool{} + for _, r := range Readings(calendar.Selection{Form: "new"}, nil, time.Date(2026, 1, 1, 0, 0, 0, 0, time.UTC), day) { + parts[r.Part] = true + } + if !parts["first"] || !parts["second"] || !parts["gospel"] { + t.Errorf("%s-%s: got parts %v, want first+second+gospel", tc.slug, tc.cycle, parts) + } + } +} |
