mirror of
https://github.com/truewhile/MeBox.git
synced 2026-10-06 21:36:37 +08:00
refactor: split modules and harden scraping workflows
This commit is contained in:
@@ -9,6 +9,21 @@ func TestBuildSubscribeKeyword(t *testing.T) {
|
||||
if got := buildSubscribeKeyword("沙丘", 0); got != "沙丘" {
|
||||
t.Fatalf("keyword without year = %q", got)
|
||||
}
|
||||
if got := buildSubscribeKeyword("", 2024); got != "" {
|
||||
t.Fatalf("empty keyword = %q, want empty", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestBuildSubscribeAliasesIncludesOriginalTitleWithYear(t *testing.T) {
|
||||
got := buildSubscribeAliases("玩具总动员 5", "Toy Story 5", 2026)
|
||||
for _, want := range []string{"玩具总动员 5", "Toy Story 5", "玩具总动员 5 2026", "Toy Story 5 2026"} {
|
||||
if !containsString(got, want) {
|
||||
t.Fatalf("aliases = %#v, missing %q", got, want)
|
||||
}
|
||||
}
|
||||
if containsString(got, "2026") {
|
||||
t.Fatalf("aliases = %#v, must not include bare year", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestDedupeExternalMedia(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user