From 97f704b659ea6c72c4aa354378b347283ecc5cac Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Tue, 28 Jul 2026 09:46:54 +0200 Subject: feat(of): proper Mass readings for the sanctoral (from catholic-resources.org) OF feasts, solemnities, and proper-reading memorials had no readings of their own and fell back to the day's ferial (Barnabas showed the ferial instead of Acts 11; Our Lady of Sorrows / the Guardian Angels showed the ferial instead of their proper gospel). scripts/gen-of-sanctoral-readings.py scrapes catholic-resources.org's Proper of Saints table and inlines reading.first/psalm/second/gospel into roman-calendar.ini for the 41 universal-calendar celebrations marked PROPER (plus every feast/solemnity); memorials that draw on a Common keep the ferial, which is the OF default. Handles the source quirks: 'or' alternatives (takes the first), cycle-specific A:/B:/C: gospels (takes A), lectionary # refs, and vigil-vs-day (keeps the day Mass). All 41 render; citations only. Adds TestUniversalSanctoralReadings, credits the source in NOTICE, bumps to 0.41.0. --- internal/caldata/caldata_test.go | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'internal/caldata/caldata_test.go') diff --git a/internal/caldata/caldata_test.go b/internal/caldata/caldata_test.go index 5ffa57e..0d6616e 100644 --- a/internal/caldata/caldata_test.go +++ b/internal/caldata/caldata_test.go @@ -1,6 +1,7 @@ package caldata import ( + "strings" "testing" "github.com/lukaszkasprzak/lectio/internal/calendar" @@ -30,6 +31,31 @@ func TestUniversalLoads(t *testing.T) { } } +func TestUniversalSanctoralReadings(t *testing.T) { + l := Universal() + // A feast/solemnity or a PROPER-reading memorial carries its own inline Mass + // (imported from catholic-resources.org) rather than falling back to the ferial. + want := map[string][2]string{ // slug -> {reading.first substr, reading.gospel substr} + "barnabas-the-apostle": {"Acts 11", "Matthew 10:7-13"}, + "assumption-of-the-blessed-virgin-mary": {"Revelation 11", "Luke 1:39-56"}, + "our-lady-of-sorrows": {"Hebrews 5", "John 19:25-27"}, + "all-saints": {"Revelation 7", "Matthew 5:1-12"}, + } + for slug, w := range want { + rc, ok := l.Cels[slug] + if !ok { + t.Errorf("missing %q", slug) + continue + } + if got := rc.Fields["reading.first"]; !strings.Contains(got, w[0]) { + t.Errorf("%s: reading.first = %q, want containing %q", slug, got, w[0]) + } + if got := rc.Fields["reading.gospel"]; !strings.Contains(got, w[1]) { + t.Errorf("%s: reading.gospel = %q, want containing %q", slug, got, w[1]) + } + } +} + func TestTridentineLoads(t *testing.T) { l := Tridentine() if l.ID != "tridentine" { -- cgit v1.3