test: add title search candidate expansion test

This commit is contained in:
2026-07-06 19:09:40 +02:00
parent 3626edc231
commit a577567fdc

View File

@@ -89,6 +89,19 @@ func TestGetEpisodeTitlesSelectsSplitCourWithinSeason(t *testing.T) {
}
}
func TestTitleSearchCandidatesUseParentShowName(t *testing.T) {
got := titleSearchCandidates([]string{
"Re:Zero kara Hajimeru Isekai Seikatsu 2nd Season Part 2",
}, 6)
want := []string{
"Re:Zero kara Hajimeru Isekai Seikatsu",
"Re:Zero kara Hajimeru Isekai Seikatsu 2nd Season Part 2",
}
if !reflect.DeepEqual(got, want) {
t.Fatalf("candidates = %#v, want %#v", got, want)
}
}
func newTestClient(server *httptest.Server) *Client {
return &Client{httpClient: server.Client(), baseURL: server.URL}
}