Class JetCheckGeneration
Generator against JQF's guided byte stream.
Since jetCheck 0.3.0, GenerationEnvironment.generative(IntSource, int) is
public, so this drives generation through public API only. jetCheck reads ints
through an IntSource; routing each draw to a Random that reads the
engine's stream keeps generation byte-structured, because
IntDistribution.generateInt(Random) consumes only the bytes each draw needs.
-
Method Summary
-
Method Details
-
generate
public static <T> T generate(org.jetbrains.jetCheck.Generator<T> generator, Random random, int sizeHint) Generates one non-null value fromgenerator, drawing every int fromrandom.A constrained generator (
nonEmptyLists,suchThat) can fail to satisfy its constraint from the current input -- most often the all-zero "zeros" seed. jetCheck then throwsCannotSatisfyCondition, or a mapped generator yieldsnull. Either way this reports aSkipTrialException, the engine's standard skip signal, so the input is dropped rather than reaching the test as a leaked jetCheck exception or a spuriousNullPointerException.- Type Parameters:
T- the generated type- Parameters:
generator- the jetCheck generator bound to a parameter typerandom- the guided source of randomness (JQF'sStreamBackedRandom)sizeHint- the collection-size hint jetCheck uses to bias list and string lengths- Returns:
- a generated value, never
null - Throws:
SkipTrialException- if the generator cannot produce a value for this input
-