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

Ward Bekker <>
Wed Oct 19 21:36:38 CEST 2011


> Hi!
> 
> 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.

Thx, that did the trick!

> 
> 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
> >
> 



More information about the erlang-questions mailing list