mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
add jetCheck.Generator.integers(jetCheck.IntDistribution)
This commit is contained in:
@@ -227,9 +227,13 @@ public class Generator<T> {
|
||||
return integers(0, Integer.MAX_VALUE);
|
||||
}
|
||||
|
||||
/** Generates integers in the given range (both ends inclusive) */
|
||||
/** Generates integers uniformly distributed in the given range (both ends inclusive) */
|
||||
public static Generator<Integer> integers(int min, int max) {
|
||||
IntDistribution distribution = IntDistribution.uniform(min, max);
|
||||
return integers(IntDistribution.uniform(min, max));
|
||||
}
|
||||
|
||||
/** Generates integers with the given distribution */
|
||||
public static Generator<Integer> integers(@NotNull IntDistribution distribution) {
|
||||
return from(data -> data.drawInt(distribution));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user