diff options
| -rw-r--r-- | internal/calendar/calendar.go | 12 | ||||
| -rw-r--r-- | internal/calendar/coverage_test.go | 17 |
2 files changed, 24 insertions, 5 deletions
diff --git a/internal/calendar/calendar.go b/internal/calendar/calendar.go index 99a24b3..d224e87 100644 --- a/internal/calendar/calendar.go +++ b/internal/calendar/calendar.go @@ -125,15 +125,21 @@ type movableCel struct { // Heart, i.e. easter+69). func movableMemorialsOF(y int) []movableCel { e := Easter(y) - mk := func(off int, slug, en, pl string) movableCel { + mk := func(off int, slug, en, pl string, first, psalm, gospel string) movableCel { return movableCel{when: e.AddDate(0, 0, off), cel: Celebration{ Slug: slug, Rank: RankMemorial, Class: ClassBVM, Colour: White, Layer: "universal", Name: map[string]string{"en": en, "pl": pl}, + // Proper readings (these memorials have no fixed-date entry to key from). + Masses: []Mass{{Readings: []Reading{ + {Part: "first", Citation: first}, {Part: "psalm", Citation: psalm}, {Part: "gospel", Citation: gospel}, + }}}, }} } return []movableCel{ - mk(50, "mary-mother-of-the-church", "Mary, Mother of the Church", "Najświętszej Maryi Panny, Matki Kościoła"), - mk(69, "the-immaculate-heart-of-the-blessed-virgin-mary", "The Immaculate Heart of the Blessed Virgin Mary", "Niepokalanego Serca Najświętszej Maryi Panny"), + mk(50, "mary-mother-of-the-church", "Mary, Mother of the Church", "Najświętszej Maryi Panny, Matki Kościoła", + "Genesis 3:9-15,20", "Psalms 87:1-2,3+5,6-7", "John 19:25-34"), + mk(69, "the-immaculate-heart-of-the-blessed-virgin-mary", "The Immaculate Heart of the Blessed Virgin Mary", "Niepokalanego Serca Najświętszej Maryi Panny", + "Isaiah 61:9-11", "1 Samuel 2:1,4-5,6-7,8abcd", "Luke 2:41-51"), } } diff --git a/internal/calendar/coverage_test.go b/internal/calendar/coverage_test.go index cbd3fde..c464e56 100644 --- a/internal/calendar/coverage_test.go +++ b/internal/calendar/coverage_test.go @@ -77,10 +77,23 @@ func TestOFMovableMemorials(t *testing.T) { sel := calendar.DefaultSelection() // Ordinary Form layers := []calendar.Layer{caldata.Universal()} - // Mary, Mother of the Church: Monday after Pentecost (2027: May 17). - if got := calendar.Compute(day(2027, time.May, 17), sel, layers); got.Observed.Slug != "mary-mother-of-the-church" { + // Mary, Mother of the Church: Monday after Pentecost (2027: May 17), with its + // proper readings (not the ferial). + got := calendar.Compute(day(2027, time.May, 17), sel, layers) + if got.Observed.Slug != "mary-mother-of-the-church" { t.Errorf("2027-05-17: observed %q, want mary-mother-of-the-church", got.Observed.Slug) } + var first string + for _, m := range got.Observed.Masses { + for _, r := range m.Readings { + if r.Part == "first" { + first = r.Citation + } + } + } + if first != "Genesis 3:9-15,20" { + t.Errorf("Mary MotC first reading = %q, want Genesis 3:9-15,20", first) + } // Two obligatory memorials coincide (St Anthony of Padua + the Immaculate // Heart, 2026-06-13): both become optional and the ferial is observed. if got := calendar.Compute(day(2026, time.June, 13), sel, layers); got.Observed.Rank != calendar.RankFerial { |
