kotest-property / io.kotest.property.arbitrary / map

map

fun <A, B> Arb<A>.map(f: (A) -> B): Arb<B>

Returns a new Arb which takes its elements from the receiver and maps them using the supplied function.

fun <K, V> Arb.Companion.map(arb: Arb<Pair<K, V>>, minSize: Int = 1, maxSize: Int = 100): Arb<Map<K, V>>

Returns an Arb where each generated value is a map, with the entries of the map drawn from the given pair generating arb. The size of each generated map is a random value between the specified min and max bounds.

There are no edgecases.

This arbitrary uses a Shrinker which will reduce the size of a failing map by removing elements from the failed case until it is empty.

See Also

MapShrinker

fun <K, V> Arb.Companion.map(keyArb: Arb<K>, valueArb: Arb<V>, minSize: Int = 1, maxSize: Int = 100): Arb<Map<K, V>>

Returns an Arb where each generated value is a map, with the entries of the map drawn by combining values from the key gen and value gen. The size of each generated map is a random value between the specified min and max bounds.

There are no edgecases.

This arbitrary uses a Shrinker which will reduce the size of a failing map by removing elements until they map is empty.

See Also

MapShrinker