summaryrefslogtreecommitdiff
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.go94
1 files changed, 84 insertions, 10 deletions
diff --git a/internal/caldata/caldata_test.go b/internal/caldata/caldata_test.go
index a9bc860..2ba052d 100644
--- a/internal/caldata/caldata_test.go
+++ b/internal/caldata/caldata_test.go
@@ -216,18 +216,49 @@ func TestTridentineNoMissingEntries(t *testing.T) {
}
}
-// TestTridentineNoSpuriousRomanus: the calendarium's 9 August row reads only
-// "Vigilia, III classis.", with no "Com." line -- missalemeum's own "St.
-// Romanus" commemoration that day has no calendarium support and is a
-// genuine upstream data quirk (the same standard already applied to "St.
-// Eusebius" on 14 August, also excluded).
-func TestTridentineNoSpuriousRomanus(t *testing.T) {
+// TestTridentineRomanusAndEusebiusPresent: CORRECTED after review found the
+// opposite claim resting on an incomplete primary-source check. An earlier
+// version of this test (and of scripts/gen-sanctoral-ef.go's
+// knownSpuriousComm) asserted Romanus ABSENT, on the strength of ONE of the
+// three local Missal scans -- "1962-06-23,…LT.pdf", an ELECTRONIC
+// TRANSCRIPTION that silently drops vigil commemorations generally (also
+// missing: 7 August Donatus, 25 December Anastasia, both present elsewhere).
+// The other two, PHOTOGRAPHIC scans of the actual 1962 Missale Romanum, both
+// carry it: "missale-romanum-1962.pdf" calendarium, 9 August row: "XVI d V
+// 9 Vigilia, III classis, Commemoratio S. Romani Mart.", with the saint's
+// own proper text elsewhere in the same scan ("Et fit commemoratio S. Romani
+// Mar-"), and its own back-of-book index ("Romani Mart., 9 augusti ... 621").
+// Where the scans and the transcription disagree, the scans win -- see
+// gen-sanctoral-ef.go's own primary-source note, same rule recorded there so
+// it is not lost a second time.
+//
+// 14 August's "St. Eusebius" is the identical shape (calendarium: "XI b XIX
+// 14 Vigilia, II classis, Commemoratio S. Eusebii Conf.") and a DIFFERENT
+// person from 16 December's "St. Eusebius, Ep. et Mart." (calendarium: "V
+// XVII S. Eusebii Ep. et Mart., III classis.") -- a Confessor and a Bishop
+// and Martyr, not the same saint moved or duplicated. missalemeum gives both
+// the same bare English title, so they collide by slug; slugOverride
+// disambiguates rather than either being dropped.
+func TestTridentineRomanusAndEusebiusPresent(t *testing.T) {
l := Tridentine()
- if _, ok := l.Cels["romanus"]; ok {
- t.Error("romanus present: the calendarium's 9 August row has no Com. line to support it")
+ if rc, ok := l.Cels["romanus"]; !ok {
+ t.Error("romanus missing: the calendarium's photographic scans both carry \"Commemoratio S. Romani Mart.\" on 9 August")
+ } else if rc.Fields["date"] != "08-09" {
+ t.Errorf("romanus: date = %q, want 08-09", rc.Fields["date"])
}
- if rc, ok := l.Cels["eusebius"]; ok && rc.Fields["date"] != "12-16" {
- t.Errorf("eusebius: date = %q, want 12-16 (14 August's Eusebius has no calendarium support)", rc.Fields["date"])
+ want := map[string]string{
+ "eusebius-confessor": "08-14", // "S. Eusebii Conf." -- a Confessor
+ "eusebius": "12-16", // "S. Eusebii Ep. et Mart." -- a Bishop and Martyr, a different person
+ }
+ for slug, date := range want {
+ rc, ok := l.Cels[slug]
+ if !ok {
+ t.Errorf("missing %q (%s)", slug, date)
+ continue
+ }
+ if rc.Fields["date"] != date {
+ t.Errorf("%s: date = %q, want %q", slug, rc.Fields["date"], date)
+ }
}
}
@@ -252,3 +283,46 @@ func TestTridentineNoTransferArtifacts(t *testing.T) {
}
}
}
+
+// TestTridentineNamesPreservedAcrossRegeneration is the coverage guard a
+// regeneration silently destroying a whole language's names needed and did
+// not have: an earlier version of scripts/gen-sanctoral-ef.go's main()
+// preserved existing name.la values across a regeneration (missalemeum
+// supplies English only) but had no equivalent for name.pl -- and, because
+// the bootstrapped file has in fact never carried a name.la value, that
+// mechanism looked correct while doing nothing at all. A regeneration
+// deleted all 322 Polish names outright (name.pl count 322 -> 0), silently:
+// no test here asserted anything about a name.* field, and
+// `len(l.Cels) < 250` (TestTridentineLoads) does not notice a field going
+// missing within entries that still exist. `naming.CelebrationName`'s own
+// name[lang] -> name.en fallback (internal/naming/naming.go) then quietly
+// substituted English for Polish on every EF display in that language,
+// reaching mobile.Day(date, "ef", version, "pl") -- a shipped dlectio entry
+// point -- with no error anywhere in the chain.
+//
+// Checks both a broad coverage floor (not exactly 322: a handful of entries
+// added by this same task's own fixes -- St Agnes secundo, St Boniface
+// Martyr, St Evaristus, St Theodore, St Romanus, St Eusebius Confessor --
+// never had a curated Polish name to preserve in the first place, so 322 is
+// not achievable) and one specific, checkable value (the coordinator's own
+// example) so a coverage-only guard cannot itself be satisfied by silently
+// wrong values.
+func TestTridentineNamesPreservedAcrossRegeneration(t *testing.T) {
+ l := Tridentine()
+ n := 0
+ for _, rc := range l.Cels {
+ if rc.Fields["name.pl"] != "" {
+ n++
+ }
+ }
+ if n < 315 {
+ t.Errorf("name.pl coverage = %d entries, want >= 315 (was 322 before any of this task's fixes; a regeneration must preserve it, not merely not-crash)", n)
+ }
+ rc, ok := l.Cels["assumption-of-the-blessed-virgin-mary"]
+ if !ok {
+ t.Fatal("missing assumption-of-the-blessed-virgin-mary")
+ }
+ if got := rc.Fields["name.pl"]; got != "Wniebowzięcie N. M. P." {
+ t.Errorf("assumption-of-the-blessed-virgin-mary: name.pl = %q, want the preserved Polish name", got)
+ }
+}