0
0
Fork 0

improving coverage in top score collector

This commit is contained in:
Marty Schoch 2014-04-25 10:28:02 -06:00
parent 267811a6d2
commit ce87f46403
1 changed files with 11 additions and 0 deletions

View File

@ -80,6 +80,17 @@ func TestTop10Scores(t *testing.T) {
collector := NewTopScorerCollector(10)
collector.Collect(searcher)
maxScore := collector.MaxScore()
if maxScore != 99.0 {
t.Errorf("expected max score 99.0, got %f", maxScore)
}
total := collector.Total()
if total != 14 {
t.Errorf("expected 14 total results, got %d", total)
}
results := collector.Results()
if len(results) != 10 {