[erlang-questions] PropER generator for list of records with a sequence number

Torben Hoffmann torben.lehoff@REDACTED
Mon Dec 10 08:59:17 CET 2018


Hi Frans,

This will most likely run you into some problems with shrinking.
You would have to generate the next sequence number from the previous one,
but then no shrinking can be done since that would leave a gap in the
sequence numbers.
But maybe there is another way to do this that I can't think of right now.

Cheers,
Torben

On Mon, 10 Dec 2018 at 08:30, Frans Schneider <fchschneider@REDACTED>
wrote:

> Hi list,
>
> In PropER, I am looking for a way to generate records with one field
> being a sequence number which is incremented for each instance.
>
> -record(cache_change, {sequence_number :: sequence_number(),
>                        ...
>                        data_value :: term()).
>
> Every cache entry is supposed to have a new sequence number which is
> normally generated by the application, but I now want PropER to generate
> the sequence numbers to test drive the cache in isolation.
>
> How does one create a custom generator for this?
>
> Another, related question, is how to start an unregistered process (the
> cache) in PropER and use its pid? Normally, the caches are started from
> a simple-one-for-one supervisor. The cache should be restarted for every
> test run. PropER documentation and examples always show registered
> processes and not unregistered processes.
>
> Thanks,
>
> Frans
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>


-- 
http://www.linkedin.com/in/torbenhoffmann
@LeHoff
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20181210/96313433/attachment.htm>


More information about the erlang-questions mailing list