aboutsummaryrefslogtreecommitdiff
path: root/internal/caldata/caldata_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/caldata/caldata_test.go')
-rw-r--r--internal/caldata/caldata_test.go45
1 files changed, 45 insertions, 0 deletions
diff --git a/internal/caldata/caldata_test.go b/internal/caldata/caldata_test.go
index f993a12..2a13d3d 100644
--- a/internal/caldata/caldata_test.go
+++ b/internal/caldata/caldata_test.go
@@ -521,3 +521,48 @@ func TestEFBVMSaturdayReadings(t *testing.T) {
t.Errorf("2026-04-18: gospel = %q, want %q (the Paschaltide formulary)", gospel, "John 19:25-27")
}
}
+
+// TestEFNativityOctaveWeekdayMass pins the Mass of a WEEKDAY within the Octave
+// of the Nativity, and the Sunday it must not swallow.
+//
+// The Missal gives 29-31 December a direct formulary, "Diebus infra octavam
+// Nativitatis Domini, II classis" -- Titus 3:4-7 / Luke 2:15-20 -- and names
+// them in the calendarium ("De V die infra octavam ... II classis"). Treated
+// as ordinary ferias they fell back to the preceding Sunday and served
+// "Dominica infra octavam" (Gal 4:1-7 / Luke 2:33-40), which is a different
+// heading for a different day.
+//
+// The Sunday case is asserted too, because it is the one the wrong citation
+// blurred: when 29-31 December IS a Sunday the day really is "Dominica infra
+// octavam" and keeps that Mass. A fix that applied the weekday formulary by
+// date alone would pass the first half of this test and fail the second.
+func TestEFNativityOctaveWeekdayMass(t *testing.T) {
+ sel := calendar.Selection{Form: "old"}
+ layers := []calendar.Layer{Tridentine()}
+ get := func(date string) (string, string) {
+ day, _ := time.Parse("2006-01-02", date)
+ var first, gospel string
+ for _, r := range Readings(sel, layers, day, calendar.Compute(day, sel, layers)) {
+ switch r.Part {
+ case "first":
+ first = r.Citation
+ case "gospel":
+ gospel = r.Citation
+ }
+ }
+ return first, gospel
+ }
+ // 2026: 29-31 December are Tuesday, Wednesday, Thursday -- weekdays.
+ for _, date := range []string{"2026-12-29", "2026-12-30", "2026-12-31"} {
+ if f, g := get(date); f != "Titus 3:4-7" || g != "Luke 2:15-20" {
+ t.Errorf("%s: got %q / %q, want Titus 3:4-7 / Luke 2:15-20 "+
+ "(Diebus infra octavam Nativitatis Domini)", date, f, g)
+ }
+ }
+ // 2030: 29 December is a SUNDAY, so it is Dominica infra octavam and keeps
+ // the Sunday's own Mass.
+ if f, g := get("2030-12-29"); f != "Gal 4:1-7" || g != "Luke 2:33-40" {
+ t.Errorf("2030-12-29 (a Sunday): got %q / %q, want Gal 4:1-7 / Luke 2:33-40 "+
+ "-- the weekday formulary must not swallow Dominica infra octavam", f, g)
+ }
+}