[erlang-questions] Quickcheck/PropEr: List generator not working as expected

Magnus Klaar <>
Wed Oct 19 18:24:04 CEST 2011


All, iirc, quickcheck-ers has a notion on the size of a value built in, this
will affect the length of lists, depth of trees etc that is incremented as
more tests pass to increase the complexity of the generated test cases. You
are using proper, the knob in proper you need to tweak is the 'start_size'
option, if you start at a size greater than 0 or 1 your length-predicate
will never hold for the first value(s) in the list(constant()) sequence.

MVH Magnus

On Wed, Oct 19, 2011 at 2:29 PM, Ward Bekker <> wrote:

> See :wardbekker/proper_test.git , src/test.erl for a
> runnable demo app. Start with ./shell from the projects root
> When I test the property
> `proper:quickcheck(test:prop_ends_with_double_cons_is_true()).` The
> following error is outputted to console:
> Error: Couldn't produce an instance that satisfies all strict constraints
> after 50 tries.
> Is seems that `?SUCHTHAT(Drow, list(consonant()), length(Drow) > 2)` can't
> generate valid values.
> When I output the values generated by `list(consonant())` I notice that
> only zero or one length lists are generated. Why is that?
> Thx,
> Ward
> _______________________________________________
> erlang-questions mailing list
> http://erlang.org/mailman/listinfo/erlang-questions
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20111019/25267ea4/attachment.html>

More information about the erlang-questions mailing list