LUCENE-4211: fix another test bug

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1360979 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2012-07-12 21:59:41 +00:00
parent abf9894023
commit 7e35195b59
1 changed files with 5 additions and 5 deletions

View File

@ -330,17 +330,17 @@ public class TestPostingsOffsets extends LuceneTestCase {
docsAndPositionsAndOffsets = termsEnum.docsAndPositions(null, docsAndPositions, true);
assertNotNull(docsAndPositionsAndOffsets);
//System.out.println(" doc/freq/pos/offs");
while((doc = docsAndPositions.nextDoc()) != DocIdSetIterator.NO_MORE_DOCS) {
while((doc = docsAndPositionsAndOffsets.nextDoc()) != DocIdSetIterator.NO_MORE_DOCS) {
final List<Token> expected = actualTokens.get(term).get(docIDToID[doc]);
//System.out.println(" doc=" + docIDToID[doc] + " " + expected.size() + " freq");
assertNotNull(expected);
assertEquals(expected.size(), docsAndPositions.freq());
assertEquals(expected.size(), docsAndPositionsAndOffsets.freq());
for(Token token : expected) {
int pos = Integer.parseInt(token.type());
//System.out.println(" pos=" + pos);
assertEquals(pos, docsAndPositions.nextPosition());
assertEquals(token.startOffset(), docsAndPositions.startOffset());
assertEquals(token.endOffset(), docsAndPositions.endOffset());
assertEquals(pos, docsAndPositionsAndOffsets.nextPosition());
assertEquals(token.startOffset(), docsAndPositionsAndOffsets.startOffset());
assertEquals(token.endOffset(), docsAndPositionsAndOffsets.endOffset());
}
}
}