diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-07-28 11:00:19 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-07-28 11:00:19 +0200 |
| commit | efeadd49b9d78e29778647835bd2a454ddce73a5 (patch) | |
| tree | 6588d0090db438354f45355588179bb681d4613b /internal/calendar/names_test.go | |
| parent | f0bfe1efb93e04e0e3b9a33b8b085fc09e86af36 (diff) | |
| download | lectio-efeadd49b9d78e29778647835bd2a454ddce73a5.tar.gz lectio-efeadd49b9d78e29778647835bd2a454ddce73a5.zip | |
feat: humanize temporal-day display names (OF + EF)
Temporal days with no proper name showed a slug-derived string ('triduum fri',
'ordinary 11 tue', 'advent-dec-17'). Add calendar.HumanizeSlug, used by both
celebrationName fallbacks (cli + calfeed), turning slugs into proper liturgical
names: Good Friday, Ash Wednesday, 'Tuesday of the 11th Week in Ordinary Time',
'11th Sunday in Ordinary Time', 'December 17', 'The Most Holy Trinity', and the
EF forms ('4th Week after Pentecost', 'Passion Week', 'Ember Wednesday of
September'). Adds TestHumanizeSlug.
Diffstat (limited to 'internal/calendar/names_test.go')
| -rw-r--r-- | internal/calendar/names_test.go | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/internal/calendar/names_test.go b/internal/calendar/names_test.go new file mode 100644 index 0000000..217f481 --- /dev/null +++ b/internal/calendar/names_test.go @@ -0,0 +1,27 @@ +package calendar + +import "testing" + +func TestHumanizeSlug(t *testing.T) { + cases := map[string]string{ + "ordinary-sunday-11": "11th Sunday in Ordinary Time", + "ordinary-11-tue": "Tuesday of the 11th Week in Ordinary Time", + "advent-2-mon": "Monday of the 2nd Week of Advent", + "advent-dec-17": "December 17", + "lent-after-ashes-wed": "Ash Wednesday", + "lent-after-ashes-thu": "Thursday after Ash Wednesday", + "triduum-fri": "Good Friday", + "easter-octave-mon": "Monday in the Octave of Easter", + "christmas-jan-2": "January 2", + "christmas-after-epiphany-mon": "Monday after the Epiphany", + "trinity-sunday": "The Most Holy Trinity", + "ef-time-after-pentecost-4-tue": "Tuesday of the 4th Week after Pentecost", + "ef-passiontide-0-thursday": "Thursday of Passion Week", + "ef-september-ember-wed": "Ember Wednesday of September", + } + for slug, want := range cases { + if got := HumanizeSlug(slug); got != want { + t.Errorf("HumanizeSlug(%q) = %q, want %q", slug, got, want) + } + } +} |
