LUCENE-8931: Remove Custom ScoreDoc Equality Method (#806)

This commit is contained in:
Atri Sharma 2019-07-25 23:29:40 +05:30 committed by Adrien Grand
parent dc8e9afff9
commit 29f941baa2
1 changed files with 1 additions and 11 deletions

View File

@ -160,7 +160,7 @@ public class TestTopFieldCollectorEarlyTermination extends LuceneTestCase {
} else {
assertEquals(td2.totalHits.value, td1.totalHits.value);
}
assertTopDocsEquals(td1.scoreDocs, td2.scoreDocs);
CheckHits.checkEqual(query, td1.scoreDocs, td2.scoreDocs);
}
closeIndex();
}
@ -233,14 +233,4 @@ public class TestTopFieldCollectorEarlyTermination extends LuceneTestCase {
new Sort(new SortField("a", SortField.Type.LONG), new SortField("b", SortField.Type.STRING)),
new Sort(new SortField("c", SortField.Type.LONG), new SortField("b", SortField.Type.STRING))));
}
private static void assertTopDocsEquals(ScoreDoc[] scoreDocs1, ScoreDoc[] scoreDocs2) {
assertEquals(scoreDocs1.length, scoreDocs2.length);
for (int i = 0; i < scoreDocs1.length; ++i) {
final ScoreDoc scoreDoc1 = scoreDocs1[i];
final ScoreDoc scoreDoc2 = scoreDocs2[i];
assertEquals(scoreDoc1.doc, scoreDoc2.doc);
assertEquals(scoreDoc1.score, scoreDoc2.score, 0f);
}
}
}