[erlang-questions] Testing data with subsets using QuickCheck

Krzysztof Jurewicz krzysztof.jurewicz@REDACTED
Thu May 11 15:15:43 CEST 2017


Jesper Louis Andersen writes:

> On Wed, May 10, 2017 at 8:27 PM Alex S. <alex0player@REDACTED> wrote:
>
>> Remember that you can generate a random element of the list using built-in
>> generators. I think this would be the most natural approach.
>>
>>
> gen_alex() ->
>     ?LET(L, non_empty(list(nat())),
>       {L, elements(L)}).

Thank you. Somehow I haven’t noticed the existence of elements/1 generator. (Why is it named in plural)?



More information about the erlang-questions mailing list