From f0bfe1efb93e04e0e3b9a33b8b085fc09e86af36 Mon Sep 17 00:00:00 2001 From: Lukasz Kasprzak Date: Tue, 28 Jul 2026 10:54:28 +0200 Subject: fix(of): partial-proper memorials compose proper part + ferial (match USCCB) A memorial marked 'PROPER Gospel' (Guardian Angels, Mary Magdalene, Our Lady of Sorrows, Joseph the Worker, the Passion of John the Baptist, Sts Martha/Mary/ Lazarus) uses the FERIAL first reading + its proper gospel; one marked 'PROPER First Reading' (Barnabas) uses its proper first + the ferial gospel. Previously we imported catholic-resources' *suggested* first for the gospel-proper ones, which differs from what USCCB publishes. - readings.go: when the observed's inline Mass has only a proper gospel (or only a proper first), fill the missing reading/psalm from the day's ferial and sort into canonical order. A fully-proper feast is untouched. Factored out ofFerial(). - gen-of-sanctoral-readings.py: keep only the strictly-proper part per the CR source-note. Verified vs USCCB: Guardian Angels (2025-10-02) now = Nehemiah 8 / Ps 19 / Matt 18:1-5,10 exactly. Updates TestUniversalSanctoralReadings. --- internal/caldata/caldata_test.go | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'internal/caldata/caldata_test.go') diff --git a/internal/caldata/caldata_test.go b/internal/caldata/caldata_test.go index 0d6616e..12aa765 100644 --- a/internal/caldata/caldata_test.go +++ b/internal/caldata/caldata_test.go @@ -33,13 +33,16 @@ 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"}, + // A feast/solemnity or a PROPER-reading memorial carries its own inline Mass. + // Partial-proper memorials keep ONLY the strictly-proper part (the resolver + // fills the rest from the ferial): the Guardian Angels a proper gospel, St + // Barnabas a proper first reading, Our Lady of Sorrows a proper gospel. + want := map[string][2]string{ // slug -> {reading.first substr, reading.gospel substr; "" = absent} "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"}, + "barnabas-the-apostle": {"Acts 11", ""}, + "guardian-angels": {"", "Matthew 18:1-5"}, + "our-lady-of-sorrows": {"", "John 19:25-27"}, } for slug, w := range want { rc, ok := l.Cels[slug] @@ -47,11 +50,15 @@ func TestUniversalSanctoralReadings(t *testing.T) { 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]) + for i, part := range []string{"reading.first", "reading.gospel"} { + got := rc.Fields[part] + if w[i] == "" { + if got != "" { + t.Errorf("%s: %s = %q, want absent (ferial)", slug, part, got) + } + } else if !strings.Contains(got, w[i]) { + t.Errorf("%s: %s = %q, want containing %q", slug, part, got, w[i]) + } } } } -- cgit v1.3