summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-07-27 23:56:46 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-07-27 23:56:46 +0200
commitd8a616ac7364d2a76e066ea875a18d386c557eb8 (patch)
tree451ed3bb0b6b8f61a695e70bfd28de37db311903
parent2f20d41921a4ed08d0a7b16246215e0eee5ac512 (diff)
downloadlectio-d8a616ac7364d2a76e066ea875a18d386c557eb8.tar.gz
lectio-d8a616ac7364d2a76e066ea875a18d386c557eb8.zip
test(caldata): OF Sunday readings resolve end-to-end (real engine + table)
-rw-r--r--internal/caldata/of_test.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/internal/caldata/of_test.go b/internal/caldata/of_test.go
index b515a28..26a3695 100644
--- a/internal/caldata/of_test.go
+++ b/internal/caldata/of_test.go
@@ -31,6 +31,29 @@ func TestOFReadingsByCycle(t *testing.T) {
}
}
+func TestOFReadings2026Sunday(t *testing.T) {
+ // End-to-end: the real engine + embedded table resolve a 2026 (cycle A)
+ // Sunday's first + gospel.
+ sel := calendar.DefaultSelection() // Form defaults to the OF ("new")
+ layers := []calendar.Layer{Universal()}
+ d := time.Date(2026, 6, 7, 0, 0, 0, 0, time.UTC) // Ordinary Sunday 10, cycle A
+ day := calendar.Compute(d, sel, layers)
+ rs := Readings(sel, layers, d, day)
+ var hasFirst, hasGospel bool
+ for _, r := range rs {
+ if r.Part == "first" && r.Citation != "" {
+ hasFirst = true
+ }
+ if r.Part == "gospel" && r.Citation != "" {
+ hasGospel = true
+ }
+ }
+ if !hasFirst || !hasGospel {
+ t.Fatalf("2026-06-07 OF readings missing first/gospel: %+v (slug %s cycle %s)",
+ rs, day.Observed.Slug, day.SundayCycle)
+ }
+}
+
func TestOFWeekdayEmpty(t *testing.T) {
day := calendar.LiturgicalDay{
Observed: calendar.Celebration{Slug: "ordinary-weekday", Layer: "temporal"},