kotest-assertions / io.kotest.properties / take

take

fun <T> Gen<T>.take(amount: Int, seed: Long? = null): List<T>
Deprecated: Deprecated and will be removed in 5.0. Migrate to the new property test classes in 4.0

Draws amount values from this generator

This method will draw values from the generator until it generates amount values. This first draws from the constants pool, and if necessary starts drawing from the random pool.

This is useful if you want the generated values, but don't want to execute a property test over them (for example, by using assertAll or forAll

val gen = Gen.string()
val generatedValues: List<String> = gen.take(20)