feat(generation): select articles in three passes
This commit is contained in:
@ -140,7 +140,7 @@ func TestUseCaseIsolatesTwoUsersAndUsesOnlyEnabledSourcesAndUserInputs(t *testin
|
||||
}
|
||||
}
|
||||
|
||||
func TestUseCasePreservesLayaOrderThenAppliesPerSourceAndGlobalCaps(t *testing.T) {
|
||||
func TestUseCasePreservesRecentInputOrderWithSourcePoolsAndGlobalOutputCap(t *testing.T) {
|
||||
articles := []scraper.Article{
|
||||
{Title: "a1"}, {Title: "a2"}, {Title: "b1"}, {Title: "a3"}, {Title: "b2"},
|
||||
}
|
||||
@ -157,7 +157,7 @@ func TestUseCasePreservesLayaOrderThenAppliesPerSourceAndGlobalCaps(t *testing.T
|
||||
t.Fatalf("summary calls=%d, want 1", len(summarizer.articles))
|
||||
}
|
||||
got := candidateTitles(summarizer.articles[0])
|
||||
want := []string{"a2", "b1", "b2"}
|
||||
want := []string{"a1", "b1", "a3"}
|
||||
if !reflect.DeepEqual(got, want) {
|
||||
t.Fatalf("rank order/caps got %v, want %v", got, want)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user