Gen |
A Gen is responsible for providing values to be used in property testing. You can think of it as like an input stream for values. Each arg will provide data for a specific type . interface Gen<out A> |
PropertyContext |
A PropertyContext is used when executing a propery test. It allows feedback and tracking of the state of the property test. class PropertyContext |
PropertyTesting |
Global object for containing settings for property testing. object PropertyTesting |
PropTestConfig |
data class PropTestConfig |
RandomSource |
data class RandomSource |
RTree |
data class RTree<out A> |
Sample |
Contains a single generated value from a Gen and an RTree of lazily evaluated shrinks. data class Sample<out A> |
Shrinker |
Given a value, T, this function returns reduced values to be used as candidates for shrinking. interface Shrinker<A> |
ShrinkingMode |
sealed class ShrinkingMode |
kotlin.Long |
|
kotlin.random.Random |
checkAll |
suspend fun <A> checkAll(genA: Gen<A>, property: suspend PropertyContext.(A) -> Unit): PropertyContextsuspend fun <A> checkAll(iterations: Int, genA: Gen<A>, property: suspend PropertyContext.(A) -> Unit): PropertyContextsuspend fun <A> checkAll(config: PropTestConfig, genA: Gen<A>, property: suspend PropertyContext.(A) -> Unit): PropertyContextsuspend fun <A> checkAll(iterations: Int, config: PropTestConfig, genA: Gen<A>, property: suspend PropertyContext.(A) -> Unit): PropertyContextsuspend fun <A> checkAll(property: suspend PropertyContext.(A) -> Unit): PropertyContextsuspend fun <A> checkAll(iterations: Int, property: suspend PropertyContext.(A) -> Unit): PropertyContextsuspend fun <A> checkAll(config: PropTestConfig, property: suspend PropertyContext.(A) -> Unit): PropertyContextsuspend fun <A> checkAll(iterations: Int, config: PropTestConfig, property: suspend PropertyContext.(A) -> Unit): PropertyContextsuspend fun <A, B> checkAll(genA: Gen<A>, genB: Gen<B>, property: suspend PropertyContext.(A, B) -> Unit): PropertyContextsuspend fun <A, B> checkAll(config: PropTestConfig, genA: Gen<A>, genB: Gen<B>, property: suspend PropertyContext.(A, B) -> Unit): PropertyContextsuspend fun <A, B> checkAll(iterations: Int, genA: Gen<A>, genB: Gen<B>, property: suspend PropertyContext.(A, B) -> Unit): PropertyContextsuspend fun <A, B> checkAll(iterations: Int, config: PropTestConfig, genA: Gen<A>, genB: Gen<B>, property: suspend PropertyContext.(A, B) -> Unit): PropertyContextsuspend fun <A, B> checkAll(property: suspend PropertyContext.(A, B) -> Unit): PropertyContextsuspend fun <A, B> checkAll(config: PropTestConfig, property: suspend PropertyContext.(A, B) -> Unit): PropertyContextsuspend fun <A, B> checkAll(iterations: Int, property: suspend PropertyContext.(A, B) -> Unit): PropertyContextsuspend fun <A, B> checkAll(iterations: Int, config: PropTestConfig, property: suspend PropertyContext.(A, B) -> Unit): PropertyContext |
forAll |
suspend fun <A> forAll(genA: Gen<A>, property: PropertyContext.(A) -> Boolean): PropertyContextsuspend fun <A> forAll(iterations: Int, genA: Gen<A>, property: PropertyContext.(A) -> Boolean): PropertyContextsuspend fun <A> forAll(config: PropTestConfig, genA: Gen<A>, property: PropertyContext.(A) -> Boolean): PropertyContextsuspend fun <A> forAll(iterations: Int, config: PropTestConfig, genA: Gen<A>, property: PropertyContext.(A) -> Boolean): PropertyContextsuspend fun <A> forAll(property: suspend PropertyContext.(A) -> Boolean): PropertyContextsuspend fun <A> forAll(iterations: Int, property: suspend PropertyContext.(A) -> Boolean): PropertyContextsuspend fun <A> forAll(config: PropTestConfig, property: suspend PropertyContext.(A) -> Boolean): PropertyContextsuspend fun <A> forAll(iterations: Int, config: PropTestConfig, property: suspend PropertyContext.(A) -> Boolean): PropertyContextsuspend fun <A, B> forAll(genA: Gen<A>, genB: Gen<B>, property: suspend PropertyContext.(A, B) -> Boolean): PropertyContextsuspend fun <A, B> forAll(config: PropTestConfig = PropTestConfig(), genA: Gen<A>, genB: Gen<B>, property: suspend PropertyContext.(A, B) -> Boolean): PropertyContextsuspend fun <A, B> forAll(iterations: Int, genA: Gen<A>, genB: Gen<B>, property: suspend PropertyContext.(A, B) -> Boolean): PropertyContextsuspend fun <A, B> forAll(iterations: Int, config: PropTestConfig, genA: Gen<A>, genB: Gen<B>, property: suspend PropertyContext.(A, B) -> Boolean): PropertyContextsuspend fun <A, B> forAll(property: PropertyContext.(A, B) -> Boolean): PropertyContextsuspend fun <A, B> forAll(config: PropTestConfig = PropTestConfig(), property: PropertyContext.(A, B) -> Boolean): PropertyContextsuspend fun <A, B> forAll(iterations: Int, property: PropertyContext.(A, B) -> Boolean): PropertyContextsuspend fun <A, B> forAll(iterations: Int, config: PropTestConfig, property: PropertyContext.(A, B) -> Boolean): PropertyContext |
map |
fun <A, B> RTree<A>.map(f: (A) -> B): RTree<B> |
merge |
Returns a new Gen which will merge the values from this gen and the values of the supplied gen together, taking one from each in turn. fun <A, B : A> Gen<A>.merge(other: Gen<B>): Gen<A> |
rtree |
Generates an RTree of all shrinks from an initial value. fun <A> Shrinker<A>.rtree(a: A): RTree<A> |
sampleOf |
fun <A> sampleOf(a: A, shrinker: Shrinker<A>): Sample<A> |