mirror of https://github.com/apache/lucene.git
add test for when fixed dv is not really fixed length
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1370241 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
7ca42b800a
commit
1ff47b2c08
|
@ -1025,4 +1025,21 @@ public class TestDocValuesIndexing extends LuceneTestCase {
|
|||
w.close();
|
||||
d.close();
|
||||
}
|
||||
|
||||
public void testFixedLengthNotReallyFixed() throws IOException {
|
||||
Directory d = newDirectory();
|
||||
IndexWriter w = new IndexWriter(d, new IndexWriterConfig(TEST_VERSION_CURRENT, new MockAnalyzer(random())));
|
||||
Document doc = new Document();
|
||||
doc.add(new DerefBytesDocValuesField("foo", new BytesRef("bar"), true));
|
||||
w.addDocument(doc);
|
||||
doc = new Document();
|
||||
doc.add(new DerefBytesDocValuesField("foo", new BytesRef("bazz"), true));
|
||||
try {
|
||||
w.addDocument(doc);
|
||||
} catch (IllegalArgumentException expected) {
|
||||
// expected
|
||||
}
|
||||
w.close();
|
||||
d.close();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue