diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-08-18 16:08:44 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-08-18 16:08:44 +0200 |
| commit | b7b28ab0ba96717b7222bb892806d7dc828a966f (patch) | |
| tree | 590651b88a173f6e35e2ebfa53d945a12b988425 /internal/calendar/temporal_ef_test.go | |
| parent | 967e911728eefb85dc53065c73c5c5d4cdce6a59 (diff) | |
| parent | 27acee1930dc728b286c655cb66bd5e44804df6f (diff) | |
| download | lectio-b7b28ab0ba96717b7222bb892806d7dc828a966f.tar.gz lectio-b7b28ab0ba96717b7222bb892806d7dc828a966f.zip | |
merge: RG 72's Christmas Time boundary, and the season/slug split it needed
Separates the liturgical season from the season that names slugs and numbers
weeks, so the boundary could move without renaming every slug in the window.
Diffstat (limited to 'internal/calendar/temporal_ef_test.go')
| -rw-r--r-- | internal/calendar/temporal_ef_test.go | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/internal/calendar/temporal_ef_test.go b/internal/calendar/temporal_ef_test.go index db6e6aa..7dd7400 100644 --- a/internal/calendar/temporal_ef_test.go +++ b/internal/calendar/temporal_ef_test.go @@ -147,3 +147,60 @@ func TestTemporalEFEmberDayRanks(t *testing.T) { } } } + +// TestTemporalEFChristmastideBoundary pins RG 72's boundary and, just as +// importantly, the SEPARATION it required. +// +// RG 72: "Tempus natalicium decurrit a I Vesperis Nativitatis Domini usque ad +// diem 13 ianuarii INCLUSIVE." Christmas Time runs to 13 January, so 6-13 +// January is the Epiphany section OF Christmas Time, not the beginning of Time +// after Epiphany. RG 119(a) backs it from the colour side, white "usque ad +// expletum tempus Epiphaniae". +// +// lectio ended Christmas Time on 5 January, so those eight days came out +// green. The fix could not be the boundary constant alone: efSeason both named +// the slugs and reported the season, so moving it renamed every slug in the +// window and orphaned the ef-time-after-epiphany-sunday-1 lectionary key. The +// season and the slug are now separate axes -- efSeason and efSlugSeason -- +// and this test pins BOTH, because a future "simplification" that merges them +// again would pass any test that checked only one. +func TestTemporalEFChristmastideBoundary(t *testing.T) { + for _, c := range []struct { + date, season, slug string + }{ + // Epiphany itself is inside Christmas Time, not the start of what + // follows it. Its slug is unchanged. + {"2026-01-06", "christmas", "ef-epiphany"}, + // The window: season christmas, slugs and week numbers still Epiphany's. + {"2026-01-07", "christmas", "ef-time-after-epiphany-1-wednesday"}, + {"2026-01-11", "christmas", "ef-time-after-epiphany-sunday-1"}, + {"2026-01-12", "christmas", "ef-time-after-epiphany-1-monday"}, + // 13 January is INCLUSIVE -- the last day of Christmas Time. It carries + // the Commemoration of the Baptism, so only the season is asserted. + {"2026-01-13", "christmas", ""}, + // 14 January is the first day that is genuinely Time after Epiphany. + {"2026-01-14", "time-after-epiphany", ""}, + // The other end, unchanged: 5 January is Christmas Time by the old + // boundary too, so a regression that moved the boundary the wrong way + // would not show here -- which is why 14 January above is asserted. + {"2026-01-05", "christmas", ""}, + } { + got := temporalEF(d(c.date)) + if string(got.Season) != c.season { + t.Errorf("%s: season = %q, want %q (RG 72: Christmas Time runs to 13 January inclusive)", + c.date, got.Season, c.season) + } + if c.slug != "" && got.Cel.Slug != c.slug { + t.Errorf("%s: slug = %q, want %q -- the SLUG season must stay Epiphany's here; "+ + "if this fails with an ef-christmas-* slug, efSeason and efSlugSeason have been "+ + "merged again and the lectionary keys are orphaned", c.date, got.Cel.Slug, c.slug) + } + } + // The colour follows from the season, and is the reason any of this + // matters: eight days a year were green that should be white. + for _, day := range []string{"2026-01-07", "2026-01-09", "2026-01-12"} { + if got := temporalEF(d(day)).Cel.Colour; got != White { + t.Errorf("%s: colour = %s, want white (RG 119(a), following from the season)", day, got) + } + } +} |
