Skip to content

Commit d8125c4

Browse files
committed
feat: fail early if min > max in ArrayMutator
1 parent cb1fb37 commit d8125c4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/main/java/com/code_intelligence/jazzer/mutation/mutator/collection/ArrayMutatorFactory.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@ private static final class ArrayMutator<T> extends SerializingMutator<T[]> {
8686
require(
8787
minLength >= 0,
8888
format("WithLength#min=%d needs to be greater than or equal to 0", minLength));
89+
require(
90+
minLength <= maxLength,
91+
format(
92+
"WithLength#min=%d needs to be smaller or equal than WithLength#max=%d",
93+
minLength, maxLength));
8994
}
9095

9196
@Override

0 commit comments

Comments
 (0)