mayya-sharipova commented on a change in pull request #1937:
URL: https://github.com/apache/lucene-solr/pull/1937#discussion_r499499632



##########
File path: 
lucene/core/src/test/org/apache/lucene/search/TestConjunctionDISI.java
##########
@@ -391,4 +391,20 @@ public void testCollapseSubConjunctionDISIs() throws 
IOException {
   public void testCollapseSubConjunctionScorers() throws IOException {
     testCollapseSubConjunctions(true);
   }
+
+  public void testIllegalAdvancementOfSubIteratorsTripsAssertion() throws 
IOException {
+    int maxDoc = 100;
+    final int numIterators = TestUtil.nextInt(random(), 2, 5);
+    FixedBitSet set = randomSet(maxDoc);
+
+    DocIdSetIterator[] iterators = new DocIdSetIterator[numIterators];
+    for (int i = 0; i < iterators.length; ++i) {
+      iterators[i] = new BitDocIdSet(set).iterator();
+    }
+    final DocIdSetIterator conjunction = 
ConjunctionDISI.intersectIterators(Arrays.asList(iterators));
+    int idx = TestUtil.nextInt(random() , 0, iterators.length-1);
+    iterators[idx].nextDoc(); // illegally advancing one of the sub-iterators 
outside of the conjunction iterator
+    AssertionError ex = expectThrows(AssertionError.class, () -> 
conjunction.nextDoc());
+    assertEquals(ex.getMessage(), "Sub-iterators of ConjunctionDISI are not 
the same document!");

Review comment:
       Thanks @jpountz, my mistake, addressed in bf9a3e8




----------------------------------------------------------------
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.

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