mirror of https://github.com/apache/lucene.git
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:
parent
abf9894023
commit
7e35195b59
|
@ -330,17 +330,17 @@ public class TestPostingsOffsets extends LuceneTestCase {
|
||||||
docsAndPositionsAndOffsets = termsEnum.docsAndPositions(null, docsAndPositions, true);
|
docsAndPositionsAndOffsets = termsEnum.docsAndPositions(null, docsAndPositions, true);
|
||||||
assertNotNull(docsAndPositionsAndOffsets);
|
assertNotNull(docsAndPositionsAndOffsets);
|
||||||
//System.out.println(" doc/freq/pos/offs");
|
//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]);
|
final List<Token> expected = actualTokens.get(term).get(docIDToID[doc]);
|
||||||
//System.out.println(" doc=" + docIDToID[doc] + " " + expected.size() + " freq");
|
//System.out.println(" doc=" + docIDToID[doc] + " " + expected.size() + " freq");
|
||||||
assertNotNull(expected);
|
assertNotNull(expected);
|
||||||
assertEquals(expected.size(), docsAndPositions.freq());
|
assertEquals(expected.size(), docsAndPositionsAndOffsets.freq());
|
||||||
for(Token token : expected) {
|
for(Token token : expected) {
|
||||||
int pos = Integer.parseInt(token.type());
|
int pos = Integer.parseInt(token.type());
|
||||||
//System.out.println(" pos=" + pos);
|
//System.out.println(" pos=" + pos);
|
||||||
assertEquals(pos, docsAndPositions.nextPosition());
|
assertEquals(pos, docsAndPositionsAndOffsets.nextPosition());
|
||||||
assertEquals(token.startOffset(), docsAndPositions.startOffset());
|
assertEquals(token.startOffset(), docsAndPositionsAndOffsets.startOffset());
|
||||||
assertEquals(token.endOffset(), docsAndPositions.endOffset());
|
assertEquals(token.endOffset(), docsAndPositionsAndOffsets.endOffset());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue