kotest-property / io.kotest.property.arbitrary / choice

choice

fun <A> Arb.Companion.choice(vararg gens: Gen<A>): Gen<A>
Deprecated: Deprecated in favor of a function that returns an Arb instead of a Gen

Randomly selects one of the given gens to generate the next element. The input must be non-empty. The input gens must be infinite.

fun <A> Arb.Companion.choice(vararg arbs: Arb<A>): Arb<A>

Uses the Arbs provided to randomly generate the next element. The returned Arb.edgecases() contains all of edgecases of the provided arbs The input must be non-empty. The input arbs must be infinite.

Exceptions

IllegalArgumentException - if no arbs have been passed to this function

Return
A new Arb that will randomly select values from the provided Arbs, and combine all of the provided Arbs edgecases