Closed ankhers closed 3 years ago
As the fine manual says, the binary(N)
generator takes an expression that evaluates to an integer as argument, not a generator as you have specified.
The PropEr way(TM) to do what you want is with a ?LET
. Something like:
my_binary(Min, Max) ->
?LET(N, range(Min, Max), binary(N)).
That makes sense. Thank you for the clarification!
I was wondering how I am supposed to generate a binary with a min and max size? I have tried using
binary(range(0,10))
, but I am getting the following error.If you have any insight, it would be greatly appreciated.