diff options
Diffstat (limited to 'internal/caldata/caldata_test.go')
| -rw-r--r-- | internal/caldata/caldata_test.go | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/internal/caldata/caldata_test.go b/internal/caldata/caldata_test.go index 95bb7dc..f993a12 100644 --- a/internal/caldata/caldata_test.go +++ b/internal/caldata/caldata_test.go @@ -5,6 +5,7 @@ import ( "testing" "github.com/lukaszkasprzak/lectio/internal/calendar" + "time" ) func TestUniversalLoads(t *testing.T) { @@ -473,3 +474,50 @@ func TestTridentineMissalOverrides(t *testing.T) { } } } + +// TestEFBVMSaturdayReadings pins RG 309(a)'s seasonal selection among the five +// Missae de sancta Maria in sabbato. Without it the day was kept as Our Lady's +// office (RG 78) but read the FERIA's Mass -- so a Saturday in Septuagesima +// announced Our Lady and then read the parable of the labourers. +// +// Citations verified by colitur against both photographic scans of the 1962 +// Missal; see its lectionary_ef.ml for the per-formulary scan references. +func TestEFBVMSaturdayReadings(t *testing.T) { + sel := calendar.Selection{Form: "old"} + for _, c := range []struct{ date, first string }{ + {"2026-01-03", "Titus 3:4-7"}, // Christmas Time + {"2026-01-10", "Titus 3:4-7"}, // still Christmas Time + {"2026-02-14", "Ecclus 24:14-16"}, // after the Purification + {"2026-06-20", "Ecclus 24:14-16"}, // Time after Pentecost + {"2026-04-18", "Ecclus 24:14-16"}, // Paschaltide -- same first, DIFFERENT gospel + } { + day, _ := time.Parse("2006-01-02", c.date) + layers := []calendar.Layer{Tridentine()} + ld := calendar.Compute(day, sel, layers) + got := Readings(sel, layers, day, ld) + if len(got) == 0 || got[0].Citation != c.first { + first := "(none)" + if len(got) > 0 { + first = got[0].Citation + } + t.Errorf("%s: first reading = %q, want %q (RG 309(a), the Mass of Our Lady on Saturday)", + c.date, first, c.first) + } + } + // Paschaltide shares its first reading with the rest of the year but has + // its own gospel -- St John at the Cross rather than the woman in the + // crowd. Asserted separately because a first-reading-only test would pass + // with the wrong gospel. + day, _ := time.Parse("2006-01-02", "2026-04-18") + layers := []calendar.Layer{Tridentine()} + got := Readings(sel, layers, day, calendar.Compute(day, sel, layers)) + var gospel string + for _, r := range got { + if r.Part == "gospel" { + gospel = r.Citation + } + } + if gospel != "John 19:25-27" { + t.Errorf("2026-04-18: gospel = %q, want %q (the Paschaltide formulary)", gospel, "John 19:25-27") + } +} |
