Improve base range field query test case failure output

This commit is contained in:
Tim Grein 2024-05-19 12:34:22 +02:00
parent c5331df1c4
commit 85d2b4611e
1 changed files with 7 additions and 4 deletions

View File

@ -303,10 +303,12 @@ public abstract class BaseRangeFieldQueryTestCase extends LuceneTestCase {
assertEquals(docID, docIDToID.nextDoc()); assertEquals(docID, docIDToID.nextDoc());
int id = (int) docIDToID.longValue(); int id = (int) docIDToID.longValue();
boolean expected; boolean expected;
if (liveDocs != null && liveDocs.get(docID) == false) { boolean isDeleted = liveDocs != null && liveDocs.get(docID) == false;
// document is deleted boolean isMissing = ranges[id][0].isMissing;
if (isDeleted) {
expected = false; expected = false;
} else if (ranges[id][0].isMissing) { } else if (isMissing) {
expected = false; expected = false;
} else { } else {
expected = expectedResult(queryRange, ranges[id], queryType); expected = expectedResult(queryRange, ranges[id], queryType);
@ -330,7 +332,8 @@ public abstract class BaseRangeFieldQueryTestCase extends LuceneTestCase {
b.append(ranges[id][n]); b.append(ranges[id][n]);
} }
b.append("\n queryType=").append(queryType).append("\n"); b.append("\n queryType=").append(queryType).append("\n");
b.append(" deleted?=").append(liveDocs != null && liveDocs.get(docID) == false); b.append(" docDeleted?=").append(isDeleted).append("\n");
b.append(" rangeMissing?=").append(isMissing);
fail("wrong hit (first of possibly more):\n\n" + b); fail("wrong hit (first of possibly more):\n\n" + b);
} }
} }