diff --git a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestRandomChains.java b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestRandomChains.java index 50a620ef7a1..b100b8d6752 100644 --- a/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestRandomChains.java +++ b/lucene/analysis/common/src/test/org/apache/lucene/analysis/core/TestRandomChains.java @@ -67,6 +67,8 @@ import org.apache.lucene.analysis.compound.hyphenation.HyphenationTree; import org.apache.lucene.analysis.hunspell.HunspellDictionary; import org.apache.lucene.analysis.hunspell.HunspellDictionaryTest; import org.apache.lucene.analysis.miscellaneous.HyphenatedWordsFilter; +import org.apache.lucene.analysis.miscellaneous.KeepWordFilter; +import org.apache.lucene.analysis.miscellaneous.LengthFilter; import org.apache.lucene.analysis.miscellaneous.LimitTokenCountFilter; import org.apache.lucene.analysis.miscellaneous.TrimFilter; import org.apache.lucene.analysis.miscellaneous.WordDelimiterFilter; @@ -197,6 +199,26 @@ public class TestRandomChains extends BaseTokenStreamTestCase { return !(Boolean) args[0]; } }); + brokenOffsetsConstructors.put( + LengthFilter.class.getConstructor(boolean.class, TokenStream.class, int.class, int.class), + new Predicate() { + @Override + public boolean apply(Object[] args) { + assert args.length == 4; + // LUCENE-4065: only if you pass 'false' to enablePositionIncrements! + return !(Boolean) args[0]; + } + }); + brokenOffsetsConstructors.put( + KeepWordFilter.class.getConstructor(boolean.class, TokenStream.class, CharArraySet.class), + new Predicate() { + @Override + public boolean apply(Object[] args) { + assert args.length == 3; + // LUCENE-4065: only if you pass 'false' to enablePositionIncrements! + return !(Boolean) args[0]; + } + }); for (Class c : Arrays.>asList( ReversePathHierarchyTokenizer.class, PathHierarchyTokenizer.class,