LUCENE-3813: improve testEmpty to also check that the iterator is exhausted

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1291883 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Robert Muir 2012-02-21 15:58:12 +00:00
parent 7e6c8fa33b
commit 9527a9e397
1 changed files with 5 additions and 2 deletions

View File

@ -25,6 +25,7 @@ import org.apache.lucene.search.spell.Dictionary;
import org.apache.lucene.search.spell.HighFrequencyDictionary;
import org.apache.lucene.search.spell.SortedIterator;
import org.apache.lucene.store.Directory;
import org.apache.lucene.util.BytesRefIterator;
import org.apache.lucene.util.LuceneTestCase;
public class TestHighFrequencyDictionary extends LuceneTestCase {
@ -35,8 +36,10 @@ public class TestHighFrequencyDictionary extends LuceneTestCase {
writer.close();
IndexReader ir = DirectoryReader.open(dir);
Dictionary dictionary = new HighFrequencyDictionary(ir, "bogus", 0.1f);
SortedIterator tf = (SortedIterator)dictionary.getWordsIterator();
tf.comparator();
BytesRefIterator tf = dictionary.getWordsIterator();
assertTrue(tf instanceof SortedIterator);
((SortedIterator)tf).comparator();
assertNull(tf.next());
dir.close();
}
}