kotest-property / io.kotest.property.arbitrary / choose

choose

fun <A : Any> Arb.Companion.choose(a: Pair<Int, A>, b: Pair<Int, A>, vararg cs: Pair<Int, A>): Arb<A>

Returns a stream of values based on weights:

Arb.choose(1 to 'A', 2 to 'B') will generate 'A' 33% of the time and 'B' 66% of the time.

Exceptions

IllegalArgumentException - If any negative weight is given or only weights of zero are given.