diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-08-14 13:22:16 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-08-14 13:22:16 +0200 |
| commit | 913974b10a993af251b25125d1a417c452ad785c (patch) | |
| tree | 5dd82811c100de6daa995bebd115a12434296508 /internal/readings/readings_test.go | |
| parent | d7da4b09f7775276231d0241cfe2700d247728ee (diff) | |
| parent | 3b32c002d3eddda5ece9422442717657b9fee63b (diff) | |
| download | lectio-913974b10a993af251b25125d1a417c452ad785c.tar.gz lectio-913974b10a993af251b25125d1a417c452ad785c.zip | |
Merge branch 'polish-ui-and-calendar': the gomobile facade and the EF calendar fixes
Two bodies of work that shared a branch.
The gomobile facade (2026-08-03..05): mobile.PartLabels, Days, and the
observed rank on DayInfo, so dlectio stops hardcoding part IDs and rank
strings; the 1962 part labels become i18n data; the documented gomobile
bind command is corrected so it reproduces the shipped .aar.
The EF calendar fixes (2026-08-12): seven defects found by differencing
this engine against colitur, a second 1962 implementation built from the
Missal's General Rubrics rather than from this codebase. RG 96 transfers
were not skipping II-class days; a II-class privileged feria was not
yielding to a feast; Sunday ranks, the two Rose Sundays and Holy Thursday's
colour were wrong; and scripts/gen-sanctoral-ef inferred ranks, deduped
and tagged classes wrongly, which put 15 III-class feasts into the shipped
tridentine-calendar.ini as bare commemorations and dropped four entries
outright.
Holy Thursday was violet in both engines, which is how a shared lineage
hides a defect: this project's ini is generated from missalemeum and
colitur's data was bootstrapped from here, so an error inherited by both
is invisible to a differential. It took the Missal itself to see it.
The EF oracle test now asserts rank and colour, not season alone. One
known gap is recorded in the source rather than fixed, as out of scope:
RG 95 chained transfers (calendar.go).
Diffstat (limited to 'internal/readings/readings_test.go')
| -rw-r--r-- | internal/readings/readings_test.go | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/internal/readings/readings_test.go b/internal/readings/readings_test.go index 143b43e..1674d85 100644 --- a/internal/readings/readings_test.go +++ b/internal/readings/readings_test.go @@ -99,6 +99,43 @@ func TestLoadModern(t *testing.T) { } } +// TestSundayRankIsDisplayOnly guards the Ordinary Form's Sunday display rank. +// Sunday is its own category in the 1969 Universal Norms' Table of Liturgical +// Days -- never a solemnity -- so an ordinary "Nth Sunday of <season>" temporal +// day (Ordinary Time, Advent, Lent, the Easter season, Christmas time; this +// also covers Palm Sunday) must report "sunday". A NAMED solemnity of the Lord +// that happens to fall on a Sunday (Easter Sunday itself, Pentecost) is a +// genuine solemnity and must keep reporting "solemnity"; a feast of the Lord +// (Holy Family) must keep reporting "feast". This is display-only: it must +// never touch the engine's internal precedence, so the 1962 form (which has no +// such Sunday category -- Sundays report their class exactly as before) is +// asserted unchanged too. Dates are the ones from the original bug report, +// plus the Easter/Pentecost/Holy Family dates they imply for the same +// liturgical year. +func TestSundayRankIsDisplayOnly(t *testing.T) { + cases := []struct { + date, lect, wantRank, why string + }{ + {"2026-08-09", "new", "sunday", "19th Sunday in Ordinary Time"}, + {"2026-11-29", "new", "sunday", "1st Sunday of Advent"}, + {"2027-03-28", "new", "solemnity", "Easter Sunday itself"}, + {"2027-05-16", "new", "solemnity", "Pentecost"}, + {"2026-12-27", "new", "feast", "Holy Family"}, + {"2026-08-09", "traditional", "class-2", "1962 Sunday after Pentecost"}, + {"2026-11-29", "traditional", "class-1", "1962 1st Sunday of Advent"}, + } + for _, c := range cases { + cfg := config.Config{Lectionary: c.lect} + _, info, err := Load(cfg, Options{Date: c.date, All: true}) + if err != nil { + t.Fatalf("%s (%s, %s): Load: %v", c.date, c.lect, c.why, err) + } + if info.Rank != c.wantRank { + t.Errorf("%s (%s, %s): Rank = %q, want %q (name=%q)", c.date, c.lect, c.why, info.Rank, c.wantRank, info.Name) + } + } +} + // TestLoadTraditional computes the Extraordinary Form day offline: it never // needs the network, and yields the EF epistle+gospel with a header name. func TestLoadTraditional(t *testing.T) { |
