diff options
Diffstat (limited to 'internal/calendar/computus_test.go')
| -rw-r--r-- | internal/calendar/computus_test.go | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/internal/calendar/computus_test.go b/internal/calendar/computus_test.go new file mode 100644 index 0000000..c524093 --- /dev/null +++ b/internal/calendar/computus_test.go @@ -0,0 +1,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) + } + } +} |
