Skip to content

Commit 341733f

Browse files
authored
Implement AssertingPostingsEnum#intoBitSet. (#14675)
This improves test coverage a bit.
1 parent f16e2f3 commit 341733f

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

lucene/test-framework/src/java/org/apache/lucene/tests/index/AssertingLeafReader.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,24 @@ public BytesRef getPayload() throws IOException {
578578
return payload;
579579
}
580580

581+
@Override
582+
public void intoBitSet(int upTo, FixedBitSet bitSet, int offset) throws IOException {
583+
assertThread("Docs enums", creationThread);
584+
assert state != DocsEnumState.START : "intoBitSet() called before nextDoc()/advance()";
585+
in.intoBitSet(upTo, bitSet, offset);
586+
assert in.docID() >= upTo;
587+
assert in.docID() >= doc;
588+
doc = in.docID();
589+
if (doc == DocIdSetIterator.NO_MORE_DOCS) {
590+
state = DocsEnumState.FINISHED;
591+
positionMax = 0;
592+
} else {
593+
state = DocsEnumState.ITERATING;
594+
positionMax = super.freq();
595+
}
596+
positionCount = 0;
597+
}
598+
581599
void reset() {
582600
state = DocsEnumState.START;
583601
doc = in.docID();

0 commit comments

Comments
 (0)