From dae3e304a17502e85cea5d10166aed20ac99c078 Mon Sep 17 00:00:00 2001 From: Alan Woodward Date: Sun, 16 Dec 2018 11:26:40 +0000 Subject: [PATCH] LUCENE-8597: TestIntervals.assertGaps() needs to take docBase into account --- .../test/org/apache/lucene/search/intervals/TestIntervals.java | 1 + 1 file changed, 1 insertion(+) diff --git a/lucene/sandbox/src/test/org/apache/lucene/search/intervals/TestIntervals.java b/lucene/sandbox/src/test/org/apache/lucene/search/intervals/TestIntervals.java index 0dee62fb944..03085504182 100644 --- a/lucene/sandbox/src/test/org/apache/lucene/search/intervals/TestIntervals.java +++ b/lucene/sandbox/src/test/org/apache/lucene/search/intervals/TestIntervals.java @@ -153,6 +153,7 @@ public class TestIntervals extends LuceneTestCase { int ord = ReaderUtil.subIndex(doc, searcher.getIndexReader().leaves()); LeafReaderContext ctx = searcher.getIndexReader().leaves().get(ord); IntervalIterator it = source.intervals(field, ctx); + doc = doc - ctx.docBase; assertEquals(doc, it.advance(doc)); for (int expectedGap : expectedGaps) { if (it.nextInterval() == IntervalIterator.NO_MORE_INTERVALS) {