diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-07-28 07:51:05 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-07-28 07:51:05 +0200 |
| commit | 1f694889f767dedd84f60d8e0cbccf201c2d123f (patch) | |
| tree | 0b8e85a1cf9dbce5f75a6ded538146ca8f1f389b /internal/caldata/caldata_test.go | |
| parent | cca0eb0db6cf6850d55d7a44fef470c594bce8ec (diff) | |
| download | lectio-1f694889f767dedd84f60d8e0cbccf201c2d123f.tar.gz lectio-1f694889f767dedd84f60d8e0cbccf201c2d123f.zip | |
feat(ef): full 1962 universal sanctoral (16 -> 317 celebrations)
Generate internal/caldata/tridentine-calendar.ini from missalemeum's per-date
proper API (Divinum Officium 1962 data) via scripts/gen-sanctoral-ef.go: each
fixed date's observed saint with rank, colour, English name and proper
Epistle/Gospel citations, plus sancti commemorations. Multiple reference years
are tried per date so a saint occulted by a Sunday in one year is still captured
observed in another; saints never observed are ranked commemoration. Feasts of
the Lord are marked class=lord. Latin names hand-curated (missalemeum has none).
Adds TestTridentineLoads, credits missalemeum in NOTICE, bumps to 0.38.0.
Diffstat (limited to 'internal/caldata/caldata_test.go')
| -rw-r--r-- | internal/caldata/caldata_test.go | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/internal/caldata/caldata_test.go b/internal/caldata/caldata_test.go index 12aed8c..5ffa57e 100644 --- a/internal/caldata/caldata_test.go +++ b/internal/caldata/caldata_test.go @@ -29,3 +29,44 @@ func TestUniversalLoads(t *testing.T) { } } } + +func TestTridentineLoads(t *testing.T) { + l := Tridentine() + if l.ID != "tridentine" { + t.Fatalf("layer id = %q", l.ID) + } + // The full 1962 sanctoral is populated (generated from missalemeum), not the + // 16-entry bootstrap. + if len(l.Cels) < 250 { + t.Fatalf("EF sanctoral has only %d entries; expected the full calendar", len(l.Cels)) + } + // Landmark feasts must be present with the right rank/class: Sts Peter & Paul + // (I class, 06-29), the Purification/Presentation (a II class feast of the + // Lord, 02-02, which must displace a Sunday), the Immaculate Conception + // (I class, 12-08). + want := map[string]struct{ date, rank, class string }{ + "sts-peter-paul": {"06-29", "class-1", ""}, + "purification-of-the-blessed-virgin-mary": {"02-02", "class-2", "lord"}, + "immaculate-conception-of-the-blessed-virgin-mary": {"12-08", "class-1", ""}, + } + for slug, w := range want { + rc, ok := l.Cels[slug] + if !ok { + t.Errorf("missing landmark feast %q", slug) + continue + } + if rc.Fields["date"] != w.date || rc.Fields["rank"] != w.rank { + t.Errorf("%s: date/rank = %q/%q, want %q/%q", slug, rc.Fields["date"], rc.Fields["rank"], w.date, w.rank) + } + if w.class != "" && rc.Fields["class"] != w.class { + t.Errorf("%s: class = %q, want %q", slug, rc.Fields["class"], w.class) + } + } + // every entry must build into a typed Celebration whose rank parsed. + for slug, rc := range l.Cels { + c := calendar.BuildCelebrationForTest(slug, rc) + if c.Rank == calendar.RankFerial && rc.Fields["rank"] != "" { + t.Errorf("%s: rank did not parse (%q)", slug, rc.Fields["rank"]) + } + } +} |
