mirror of https://github.com/apache/lucene.git
LUCENE-7414: TestUtil.checkIterator can make tests very slow
This commit is contained in:
parent
7072458ea4
commit
18373e1129
|
@ -177,6 +177,8 @@ public final class TestUtil {
|
||||||
assert hasNext;
|
assert hasNext;
|
||||||
T v = iterator.next();
|
T v = iterator.next();
|
||||||
assert allowNull || v != null;
|
assert allowNull || v != null;
|
||||||
|
// for the first element, check that remove is not supported
|
||||||
|
if (i == 0) {
|
||||||
try {
|
try {
|
||||||
iterator.remove();
|
iterator.remove();
|
||||||
throw new AssertionError("broken iterator (supports remove): " + iterator);
|
throw new AssertionError("broken iterator (supports remove): " + iterator);
|
||||||
|
@ -184,6 +186,7 @@ public final class TestUtil {
|
||||||
// ok
|
// ok
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
assert !iterator.hasNext();
|
assert !iterator.hasNext();
|
||||||
try {
|
try {
|
||||||
iterator.next();
|
iterator.next();
|
||||||
|
|
Loading…
Reference in New Issue