aboutsummaryrefslogtreecommitdiff
path: root/internal/caldata/of_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/caldata/of_test.go')
-rw-r--r--internal/caldata/of_test.go30
1 files changed, 26 insertions, 4 deletions
diff --git a/internal/caldata/of_test.go b/internal/caldata/of_test.go
index 26a3695..91c9b59 100644
--- a/internal/caldata/of_test.go
+++ b/internal/caldata/of_test.go
@@ -24,10 +24,11 @@ func TestOFReadingsByCycle(t *testing.T) {
}
}
// The gospel of Christ the King (cycle A) is Matthew 25:31-46. The citation
- // may spell Matthew as "Mat" (niedziela/ToEnglishRef) or "Matt" (seed); both
- // resolve to Matthew via books.ini.
- if !strings.HasPrefix(gospel, "Mat 25") && !strings.HasPrefix(gospel, "Matt 25") {
- t.Fatalf("christ-the-king-A gospel = %q, want Matthew 25…", gospel)
+ // may spell Matthew as "Mat"/"Matt" (niedziela/ToEnglishRef) or "Matthew"
+ // (catholic-resources.org); all resolve to Matthew via books.ini.
+ if !strings.Contains(gospel, "25:31-46") ||
+ !(strings.HasPrefix(gospel, "Mat 25") || strings.HasPrefix(gospel, "Matt 25") || strings.HasPrefix(gospel, "Matthew 25")) {
+ t.Fatalf("christ-the-king-A gospel = %q, want Matthew 25:31-46", gospel)
}
}
@@ -63,3 +64,24 @@ func TestOFWeekdayEmpty(t *testing.T) {
t.Fatalf("weekday should be empty, got %v", rs)
}
}
+
+func TestOFSundayCompleteReadings(t *testing.T) {
+ // Every OF Sunday/solemnity Mass has a SECOND reading; the niedziela harvest
+ // had dropped it on 271 entries, restored from catholic-resources.org.
+ for _, tc := range []struct{ slug, cycle string }{
+ {"ordinary-sunday-11", "A"}, {"trinity-sunday", "A"},
+ {"palm-sunday", "B"}, {"pentecost", "C"},
+ } {
+ day := calendar.LiturgicalDay{
+ Observed: calendar.Celebration{Slug: tc.slug, Layer: "temporal"},
+ SundayCycle: tc.cycle, Weekday: time.Sunday,
+ }
+ parts := map[string]bool{}
+ for _, r := range Readings(calendar.Selection{Form: "new"}, nil, time.Date(2026, 1, 1, 0, 0, 0, 0, time.UTC), day) {
+ parts[r.Part] = true
+ }
+ if !parts["first"] || !parts["second"] || !parts["gospel"] {
+ t.Errorf("%s-%s: got parts %v, want first+second+gospel", tc.slug, tc.cycle, parts)
+ }
+ }
+}