[erlang-questions] user-specified data types in PropEr generator

Motiejus Jakštys <>
Thu Aug 11 17:47:46 CEST 2011


Hello again,

This is a follow-up email from
PropEr: specify custom types in ?SIZED() fun
http://erlang.org/pipermail/erlang-questions/2011-August/060592.html

Sorry for spamming about this, but I think now I found the most minimal
example of what I am trying to achieve. Code:

-module(properworks).
-include_lib("proper/include/proper.hrl").

-type primitive() :: binary().

struct_gen(_Size) ->
    primitive().

prop_simple() ->
    ?FORALL(_Item,
        sized_struct(Size),
        begin
            true
        end
    ).

$ erlc -pz ~/nrms/deps/proper/ebin -I
~/nrms/deps/proper properworks.erl
./properworks.erl:7: function primitive/0 undefined
./properworks.erl:4: Warning: type primitive() is unused
./properworks.erl:6: Warning: function struct_gen/1 is unused

Any way to conditionally feed custom data types to PropEr generator?

Thanks,
Motiejus



More information about the erlang-questions mailing list