<div dir="ltr"><div><div><div><div><div><div>Hi All,<br><br></div>I've gone through the code for the integer() type and have found where my issue arises from.<br><br></div>the proper_gen:pick/1 function has a default Size of 10, but the proper_gen:pick/2 function provides for a size to be passed.<br><br></div>If I call:<br><br></div>proper_gen:pick(proper_types:char(), 1114111), I get results as expected.<br><br></div>Since the definition of char() is equivalent to integer(0,16#10ffff), I would have expected the proper_gen:pick_type(proper_types:char()) call to result in the arity 2 version of this function being called, or at least have the Size set to the upper bound of the integer range in the integer_gen function call, either in proper_types:integer_gen/2 function call.<br><br></div><div>Does this make sense or am I missing something?<br><br></div><div>Regards,<br></div><div>Ryan Maclear<br></div><div><div><div><br><br><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 17 May 2018 at 11:08, Ryan Maclear <span dir="ltr"><<a href="mailto:ryanm@miranetworks.net" target="_blank">ryanm@miranetworks.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Appologies, I hit send before finisinh the email. Here is the complete mail:<span class=""><br><br><div><div><div><div><div><div><div><div><span style="font-family:arial,helvetica,sans-serif">I'm busy learning to use proper and have the following issue. When calling the function<br><code><span class="m_-8319070164835859940gmail-m_7209538006811084840gmail-tok-nn"><br></span></code></span>From the API docs, the char() type has a range of 0 to (1114111) 16#10ffff.<br></div></div><span style="font-family:arial,helvetica,sans-serif"><br>When calling the function<br><code><span class="m_-8319070164835859940gmail-m_7209538006811084840gmail-tok-nn"><br>proper_gen</span><span class="m_-8319070164835859940gmail-m_7209538006811084840gmail-tok-p">:</span><span class="m_-8319070164835859940gmail-m_7209538006811084840gmail-tok-nf">pick</span><span class="m_-8319070164835859940gmail-m_7209538006811084840gmail-tok-p">(</span><span class="m_-8319070164835859940gmail-m_7209538006811084840gmail-tok-nn">proper_types</span><span class="m_-8319070164835859940gmail-m_7209538006811084840gmail-tok-p">:</span><span class="m_-8319070164835859940gmail-m_7209538006811084840gmail-tok-nf">t<wbr>erm</span><span class="m_-8319070164835859940gmail-m_7209538006811084840gmail-tok-p">()).</span></code></span><br><br>manually
many times (I've tried in around 3000 times) and on different VMs, the
function always seems to return only one of the following values:<br><br></div>{ok,0},<br></div>{ok,2},<br></div>{ok,3},<br></div>{ok,6}<br></div>{ok,12} and<br></div><div>{ok,13}<br><br></div></span><div><span class="">I see the same behaviour for <br><br></span>proper_gen:pick(proper_types:<wbr>range(0,16#10ffff)).<br><br></div><div>which I believe is equivalent.<br></div><span class=""><div><br></div><div>I have tried on erlang 19.3.6.9, erlang 20.3.6 on a Mac as well as on a ubuntu trusty docker image with erlang 19.3.<br></div><div><br></div><div>In all three vms I see the same set of results being returned. <br><br></div><div>Is there something else I need to do before calling this function?<br><br></div><div>Thanks,<br></div><div>Ryan</div><br></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On 17 May 2018 at 11:07, Ryan Maclear <span dir="ltr"><<a href="mailto:ryanm@miranetworks.net" target="_blank">ryanm@miranetworks.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div><div><div><div><div><div><span style="font-family:arial,helvetica,sans-serif">Good Day,<br><br></span></div><span style="font-family:arial,helvetica,sans-serif">I'm busy learning to use proper and have the following issue. When calling the function<br><code><span class="m_-8319070164835859940m_7209538006811084840gmail-tok-nn"><br></span></code></span>From the API docs, the char() type has a range of 0 to (1114111) 16#10ffff.<br></div></div><span style="font-family:arial,helvetica,sans-serif"><br>When calling the function<br><code><span class="m_-8319070164835859940m_7209538006811084840gmail-tok-nn"><br>proper_gen</span><span class="m_-8319070164835859940m_7209538006811084840gmail-tok-p">:</span><span class="m_-8319070164835859940m_7209538006811084840gmail-tok-nf">pick</span><span class="m_-8319070164835859940m_7209538006811084840gmail-tok-p">(</span><span class="m_-8319070164835859940m_7209538006811084840gmail-tok-nn">proper_types</span><span class="m_-8319070164835859940m_7209538006811084840gmail-tok-p">:</span><span class="m_-8319070164835859940m_7209538006811084840gmail-tok-nf">t<wbr>erm</span><span class="m_-8319070164835859940m_7209538006811084840gmail-tok-p">()).</span></code></span><br><br>manually many times (I've tried in around 3000 times) and on different VMs, the function always seems to return only one of the following values:<br><br></div>{ok,0},<br></div>{ok,2},<br></div>{ok,3},<br></div>{ok,6}<br></div>{ok,12} and<br></div><div>{ok,13}<br><br></div><div>I see the same behaviour for <br><br></div><div><br></div><div>I have tried on erlang 19.3.6.9, erlang 20.3.6 on a Mac as well as on a ubuntu trusty docker image with erlang 19.3.<br></div><div><br></div><div>In all three vms I see the same set of results being returned. <br><br></div><div>Is there something else I need to do before calling this function?<br><br></div><div>Thanks,<br></div><div>Ryan<br></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>