func TestSlugify(t *testing.T) { cases := []struct{ name, in, want string }{ {"spaces", "Hello World", "hello-world"}, {"punctuation", "A/B?", "a-b"}, {"already clean", "ok", "ok"}, } for _, c := range cases { t.Run(c.name, func(t *testing.T) { if got := Slugify(c.in); got != c.want { t.Errorf("got %q, want %q", got, c.want) } }) } }