summaryrefslogtreecommitdiff
path: root/internal/calendar/temporal_ef_test.go
blob: 6d632e23f8ea1fa6f8f17be8d87564adce9b6fc3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package calendar

import "testing"

func TestTemporalEFSeasons(t *testing.T) {
	cases := []struct {
		date   string
		season Season
	}{
		{"2025-01-01", Christmas},          // Circumcision
		{"2025-01-20", TimeAfterEpiphany},  // after II Sunday after Epiphany
		{"2025-02-16", Septuagesima},       // Septuagesima Sunday (easter-63)
		{"2025-03-05", Lent},               // Ash Wednesday
		{"2025-04-06", Passiontide},        // Passion Sunday (easter-14)
		{"2025-04-13", Passiontide},        // Palm Sunday
		{"2025-04-20", Easter_},            // Easter
		{"2025-06-08", Easter_},            // Pentecost (still Paschaltide)
		{"2025-06-15", TimeAfterPentecost}, // Trinity
		{"2025-06-22", TimeAfterPentecost}, // II Sunday after Pentecost
		{"2025-10-26", TimeAfterPentecost}, // Christ the King
		{"2025-11-30", Advent},             // I Sunday of Advent
		{"2025-12-25", Christmas},          // Nativity
	}
	for _, c := range cases {
		got := temporalEF(d(c.date))
		if got.Season != c.season {
			t.Errorf("temporalEF(%s).Season = %s, want %s", c.date, got.Season, c.season)
		}
	}
}

func TestTemporalEFChristTheKing(t *testing.T) {
	// EF: last Sunday of October (2025-10-26), not the last before Advent.
	if got := temporalEF(d("2025-10-26")); got.Cel.Slug != "ef-christ-the-king" {
		t.Errorf("2025-10-26 slug = %q want ef-christ-the-king", got.Cel.Slug)
	}
	if got := efChristTheKing(2025).Format("2006-01-02"); got != "2025-10-26" {
		t.Errorf("efChristTheKing(2025) = %s want 2025-10-26", got)
	}
}