0
0
Fork 0

added test of query weight

This commit is contained in:
Marty Schoch 2014-04-19 15:11:29 -04:00
parent 90692be8e3
commit 4abc1cabdf
1 changed files with 6 additions and 0 deletions

View File

@ -171,6 +171,12 @@ func TestTermScorerWithQueryNorm(t *testing.T) {
scorer.SetQueryNorm(2.0)
expectedQueryWeight := 3 * idf * 3 * idf
actualQueryWeight := scorer.Weight()
if expectedQueryWeight != actualQueryWeight {
t.Errorf("expected query weight %f, got %f", expectedQueryWeight, actualQueryWeight)
}
tests := []struct {
termMatch *index.TermFieldDoc
result *DocumentMatch