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
|
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)
}
}
}
|