diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-07-27 14:00:01 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-07-27 14:00:01 +0200 |
| commit | 58b748340059a02e696f6a7168f81114ac0f99e9 (patch) | |
| tree | 956cfb133c249a4086ea7aef07a0fc7173e9150f /internal/calendar/calendar_test.go | |
| parent | ba5b6b54819b5dbea10213138d9f210373b2c629 (diff) | |
| download | lectio-58b748340059a02e696f6a7168f81114ac0f99e9.tar.gz lectio-58b748340059a02e696f6a7168f81114ac0f99e9.zip | |
feat(calendar): Compute branches on Form (computeEF via temporalEF/precedenceEF)
Diffstat (limited to 'internal/calendar/calendar_test.go')
| -rw-r--r-- | internal/calendar/calendar_test.go | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/internal/calendar/calendar_test.go b/internal/calendar/calendar_test.go index 909f1d8..28dba9e 100644 --- a/internal/calendar/calendar_test.go +++ b/internal/calendar/calendar_test.go @@ -37,3 +37,27 @@ func TestComputeCycles(t *testing.T) { t.Errorf("2025 weekday cycle = %s want I", got.WeekdayCycle) } } + +func TestComputeEF(t *testing.T) { + sel := DefaultSelection() + sel.Form = "old" + // an EF layer with a I-class feast on 2025-08-15 (Assumption) + layer := Layer{ID: "tridentine", Type: "universal", Cels: map[string]RawCelebration{ + "assumption": {Fields: map[string]string{ + "date": "08-15", "rank": "class-1", "colour": "white", "name.en": "Assumption BVM", + }, Variants: map[string]map[string]string{}}, + }} + got := Compute(d("2025-08-15"), sel, []Layer{layer}) + if got.Observed.Slug != "assumption" || got.Observed.Rank != RankClass1 { + t.Fatalf("EF 2025-08-15 observed = %q/%v want assumption/class-1", got.Observed.Slug, got.Observed.Rank) + } + // the EF season on 2025-08-15 is Time after Pentecost (not OF's "ordinary") + if got.Season != TimeAfterPentecost { + t.Errorf("EF season = %s want time-after-pentecost", got.Season) + } + // OF path unchanged for the same date + ofDay := Compute(d("2025-08-15"), DefaultSelection(), []Layer{layer}) + if ofDay.Season != Ordinary { + t.Errorf("OF season = %s want ordinary", ofDay.Season) + } +} |
