package words import "testing" func TestCount(t *testing.T) { cases := []struct { got, want string }{ {Count(1, "track", "tracks"), "1 track"}, {Count(0, "track", "tracks"), "0 tracks"}, {Count(int64(3), "track went missing", "tracks went missing"), "3 tracks went missing"}, {Count(int32(-1), "copy", "copies"), "-1 copies"}, } for _, c := range cases { if c.got != c.want { t.Errorf("got %q, want %q", c.got, c.want) } } }