Big changes
This commit is contained in:
@@ -59,6 +59,23 @@ func TestBuildProfileDeduplicatesSeeds(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestBuildProfileDoesNotCountEveryEpisodeAsAnotherTasteVote(t *testing.T) {
|
||||
history := []Item{
|
||||
episode("ep2", "Second", "series", "Series", []string{"Drama"}),
|
||||
episode("ep1", "First", "series", "Series", []string{"Drama"}),
|
||||
item("movie", "Movie", "Movie", []string{"Comedy"}, 0),
|
||||
}
|
||||
profile := BuildProfile(history, nil)
|
||||
|
||||
if profile.GenreWeights["Drama"] != 1 {
|
||||
t.Fatalf("repeated series weight = %v, want the newest occurrence only",
|
||||
profile.GenreWeights["Drama"])
|
||||
}
|
||||
if !profile.Seen["ep1"] || !profile.Seen["ep2"] || !profile.Seen["series"] {
|
||||
t.Fatalf("episode/series exclusions were lost: %+v", profile.Seen)
|
||||
}
|
||||
}
|
||||
|
||||
func TestFavoritesContributeLessThanAFreshPlay(t *testing.T) {
|
||||
fromHistory := BuildProfile([]Item{item("1", "A", "Movie", []string{"Horror"}, 0)}, nil)
|
||||
fromFavorite := BuildProfile(nil, []Item{item("2", "B", "Movie", []string{"Horror"}, 0)})
|
||||
|
||||
Reference in New Issue
Block a user