fix this test to disregard NaN scores

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1725529 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2016-01-19 14:26:27 +00:00
parent a2e5c37c85
commit 8a9e20bfa1
1 changed files with 4 additions and 2 deletions

View File

@ -1209,8 +1209,10 @@ public class TestFieldCacheSort extends LuceneTestCase {
bq.add(new MatchAllDocsQuery(), Occur.SHOULD); bq.add(new MatchAllDocsQuery(), Occur.SHOULD);
TopDocs td = searcher.search(bq.build(), 10, sort); TopDocs td = searcher.search(bq.build(), 10, sort);
assertEquals(2, td.totalHits); assertEquals(2, td.totalHits);
assertEquals(1, td.scoreDocs[0].doc); if (Float.isNaN(td.scoreDocs[0].score) == false && Float.isNaN(td.scoreDocs[1].score) == false) {
assertEquals(0, td.scoreDocs[1].doc); assertEquals(1, td.scoreDocs[0].doc);
assertEquals(0, td.scoreDocs[1].doc);
}
TestUtil.checkReader(ir); TestUtil.checkReader(ir);
ir.close(); ir.close();
dir.close(); dir.close();