I have tried something like this, but seems like it's not working since I can see negatives in the generated list:
@Property
fun <testMethodName>(
@ForAll @Size(min = 0, max = 1_500)
@Positive
@UniqueElements partials: List<@IntRange(min = 1, max = 10000) Int>
) = runTest { ... }
I wanted to generate the following:
- An array of ints
- a list with lenght between 0 to 1500
- values of every elements should be unique
- values of list elements must be between 1 to 10000
The following code works using jqwik 1.7.2 on my machine:
JqwikIntRange
is an alias fornet.jqwik.api.constraints.IntRange
since the Kotlin library has its ownIntRange
class.If this doesn't work for you, check if you've done the necessary configuration for Kotlin?