summaryrefslogtreecommitdiff
path: root/internal/calendar/computus_test.go
blob: c5240938a733c5036c6aad4ff9033410704fa863 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package calendar

import (
	"testing"
)

func TestEasterKnownDates(t *testing.T) {
	// Published Gregorian Easter Sundays.
	cases := map[int]string{
		2020: "2020-04-12", 2021: "2021-04-04", 2022: "2022-04-17",
		2024: "2024-03-31", 2025: "2025-04-20", 2027: "2027-03-28",
		2038: "2038-04-25", 2000: "2000-04-23",
	}
	for y, want := range cases {
		got := Easter(y).Format("2006-01-02")
		if got != want {
			t.Errorf("Easter(%d) = %s, want %s", y, got, want)
		}
	}
}