package naming import "testing" func TestParseFolderIDs_NumericTitleIsNotAnID(t *testing.T) { // Numeric-only anime titles must NOT be parsed as a bare trailing tvdb/tmdb id. if got := ParseFolderIDs("86", "series"); got != nil { t.Errorf(`ParseFolderIDs("86","series") = %+v, want nil`, got) } if got := ParseFolderIDs("22 7", "series"); got != nil { t.Errorf(`ParseFolderIDs("22 7","series") = %+v, want nil`, got) } // A real bare trailing id with title text must still be parsed. got := ParseFolderIDs("Some Show 81189", "series") if got == nil || got.TvdbID != "81189" { t.Errorf(`ParseFolderIDs("Some Show 81189","series") = %+v, want TvdbID="81189"`, got) } // Structured tags must still win regardless of letters. got = ParseFolderIDs("{tmdb-27205}", "movies") if got == nil || got.TmdbID != "27205" { t.Errorf(`ParseFolderIDs("{tmdb-27205}","movies") = %+v, want TmdbID="27205"`, got) } }