Generates an ASCII letter: 'a' to 'z', 'A' to 'Z'
Generates an ASCII letter: 'a' to 'z', 'A' to 'Z'
Generates an ASCII letter or digit: 'a' to 'z', 'A' to 'Z', '0' to '9'
Generates an ASCII letter or digit: 'a' to 'z', 'A' to 'Z', '0' to '9'
Generates an ASCII character
Generates an ASCII character
Generates an ASCII binit: '0' to '1'
Generates an ASCII binit: '0' to '1'
Generates a random boolean.
Generates a random boolean.
_This generator shrinks to 'False'._
Generates a random 'Array[Byte]', using 'Range' to determine the length.
Generates a random 'Array[Byte]', using 'Range' to determine the length.
_Shrinks down to the ascii characters._
Randomly selects one of the generators in the list.
Randomly selects one of the generators in the list.
This generator shrinks towards the first generator in the list.
Randomly selects one of the generators in the list.
Randomly selects one of the generators in the list.
This generator shrinks towards the first generator in the list.
Trivial generator that always produces the same element.
Trivial generator that always produces the same element.
Generates an ASCII digit: '0' to '9'
Generates an ASCII digit: '0' to '9'
Discards the whole generator.
Discards the whole generator.
*******************************************************************
*******************************************************************
Randomly selects one of the elements in the list.
Randomly selects one of the elements in the list.
This generator shrinks towards the first element in the list.
Randomly selects one of the elements in the list.
Randomly selects one of the elements in the list.
This generator shrinks towards the first element in the list.
Randomly selects one of the elements in the list.
Randomly selects one of the elements in the list.
This generator shrinks towards the first element in the list.
WARNING: This may throw an exception if the list is empty,
please use one of the other element
variants if possible
Discards the generator if the generated value does not satisfy the predicate.
Discards the generator if the generated value does not satisfy the predicate.
Generates a value that satisfies a predicate.
Generates a value that satisfies a predicate.
We keep some state to avoid looping forever. If we trigger these limits then the whole generator is discarded.
Uses a weighted distribution to randomly select one of the generators in the list.
Uses a weighted distribution to randomly select one of the generators in the list.
This generator shrinks towards the first generator in the list.
Uses a weighted distribution to randomly select one of the generators in the list.
Uses a weighted distribution to randomly select one of the generators in the list.
This generator shrinks towards the first generator in the list.
Uses a weighted distribution to randomly select one of the generators in the list.
Uses a weighted distribution to randomly select one of the generators in the list.
This generator shrinks towards the first generator in the list.
WARNING: This may throw an exception if the list is empty,
please use one of the other frequency
variants if possible.
Runs a Option
generator until it produces a Some
.
Runs a Option
generator until it produces a Some
.
This is implemented using filter
and has the same caveats.
Construct a generator that depends on the size parameter.
Construct a generator that depends on the size parameter.
Generates an ASCII hexit: '0' to '9', 'a' to 'f', 'A' to 'F'
Generates an ASCII hexit: '0' to '9', 'a' to 'f', 'A' to 'F'
*******************************************************************
*******************************************************************
Generates a random integral number in the given [inclusive,inclusive]
range.
Generates a random integral number in the given [inclusive,inclusive]
range.
When the generator tries to shrink, it will shrink towards the Range.origin of the specified Range.
For example, the following generator will produce a number between 1970
and 2100
, but will shrink towards 2000
:
Gen.integral(Range.constantFrom(2000, 1970, 2100))
Some sample outputs from this generator might look like:
=== Outcome === 1973 === Shrinks === 2000 1987 1980 1976 1974 === Outcome === 2061 === Shrinks === 2000 2031 2046 2054 2058 2060
Generates a random integral number in the [inclusive,inclusive]
range.
Generates a random integral number in the [inclusive,inclusive]
range.
This generator does not shrink.
Generates an Latin-1 character
Generates an Latin-1 character
Generates a list using a 'Range' to determine the length.
Generates a list using a 'Range' to determine the length.
Generates an ASCII lowercase letter: 'a' to 'z'
Generates an ASCII lowercase letter: 'a' to 'z'
Generates an ASCII octit: '0' to '7'
Generates an ASCII octit: '0' to '7'
Construct a generator that depends on the size parameter.
Construct a generator that depends on the size parameter.
Generates a string using 'Range' to determine the length.
Generates a string using 'Range' to determine the length.
Generates a Unicode character, excluding noncharacters and invalid standalone surrogates:
Generates a Unicode character, excluding noncharacters and invalid standalone surrogates:
Generates a Unicode character, including noncharacters and invalid standalone surrogates
Generates a Unicode character, including noncharacters and invalid standalone surrogates
Generates an ASCII uppercase letter: 'A' to 'Z'
Generates an ASCII uppercase letter: 'A' to 'Z'
This is _purely_ to make consuming this library a nicer experience, mainly due to Scala's type inference problems and higher kinds.