mikemccand commented on code in PR #13987:
URL: https://github.com/apache/lucene/pull/13987#discussion_r1837971840


##########
lucene/core/src/test/org/apache/lucene/search/TestTopFieldCollector.java:
##########
@@ -359,7 +359,7 @@ public void testTotalHitsWithScore() throws Exception {
       leafCollector.collect(1);
 
       scorer.score = 4;
-      leafCollector.collect(1);
+      leafCollector.collect(2);

Review Comment:
   Another pre-existing test bug fixed?



##########
lucene/core/src/test/org/apache/lucene/search/TestPositiveScoresOnlyCollector.java:
##########
@@ -114,8 +114,9 @@ public void testNegativeScores() throws Exception {
     Collector c = new PositiveScoresOnlyCollector(tdc);
     LeafCollector ac = c.getLeafCollector(ir.leaves().get(0));
     ac.setScorer(s);
-    while (s.iterator().nextDoc() != DocIdSetIterator.NO_MORE_DOCS) {
-      ac.collect(0);
+    int docId;
+    while ((docId = s.iterator().nextDoc()) != DocIdSetIterator.NO_MORE_DOCS) {
+      ac.collect(docId);

Review Comment:
   Wow, good catch!  So this was a latent pre-existing test bug, and with your 
above bug fix this test is now (correctly!) failing, and with your fix to this 
separate test bug, the test now passes?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to