At the moment, when `Exhaustive` is passed into `A...
# kotest
t
At the moment, when
Exhaustive
is passed into
Arb.Companion.set
, it is not validated if it has
range.last
items. Is this intended? it currently has correct behaviour possible changes: • decrease upperlimit to
values.size
, • throw an out of range-exception when possible out of range • throw the current exception immediately (we know it will fail) and no breaking changes.
e
I think last option makes most sense. Simply add a new check here. You could make it clear that
gen
is an exhaustive with too few values.
t
I was just thinking, maybe the best way to do this using Exhaustive is
values.shuffle(random).take(random)
Although this only works if
values.size == values.toSet().size
.