Skip to content

Apache Lucene open-source search software

add explicit test for the same token stacked on top of itself

Robert Muirb26fe0848eb6
diff --git a/lucene/core/src/test/org/apache/lucene/index/TestPostingsOffsets.java b/lucene/core/src/test/org/apache/lucene/index/TestPostingsOffsets.java
index 01b81d2dc3d..987594c8862 100644
--- a/lucene/core/src/test/org/apache/lucene/index/TestPostingsOffsets.java
+++ b/lucene/core/src/test/org/apache/lucene/index/TestPostingsOffsets.java
@@ -438,6 +438,14 @@ public class TestPostingsOffsets extends LuceneTestCase {
}
}
+ public void testStackedTokens() throws Exception {
+ checkTokens(new Token[] {
+ makeToken("foo", 1, 0, 3),
+ makeToken("foo", 0, 0, 3),
+ makeToken("foo", 0, 0, 3)
+ });
+ }
+
public void testLegalbutVeryLargeOffsets() throws Exception {
Directory dir = newDirectory();
IndexWriter iw = new IndexWriter(dir, newIndexWriterConfig(TEST_VERSION_CURRENT, null));