<div dir="ltr"><div><div>Most QuickCheck systems have an internal size parameter which is slowly increased over the course of testing. If you manually bump it by a lot, you get a better range:<br><br>16> proper_gen:pick(proper_types:resize(8000, proper_types:integer(0, 16#10ffff))).<br>{ok,5050}<br><br></div>However, I feel most of propers generators are botched and don't really check what they should. EQC Mini for instance:<br><br>5> eqc_gen:sample(eqc_gen:choose(0, 16#10ffff)).<br>482145<br>1062500<br>211296<br>269049<br>863625<br>4346<br>441921<br>719972<br>62442<br>703915<br>944194<br>ok<br><br></div>which is far more the range you would expect. Also note that the pick/1 function is kind of dangerous since it leads people down a path where their generators have less randomness than they should have. The right solution often involves ?LET(X, generator(), <[X] E x>) and friends.<br><br><br></div><br><div class="gmail_quote"><div dir="ltr">On Thu, May 17, 2018 at 11:34 AM Ryan Maclear <<a href="mailto:ryanm@miranetworks.net">ryanm@miranetworks.net</a>> wrote:<br></div><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:<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_293122381163732460gmail-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_293122381163732460gmail-m_7209538006811084840gmail-tok-nn"><br>proper_gen</span><span class="m_293122381163732460gmail-m_7209538006811084840gmail-tok-p">:</span><span class="m_293122381163732460gmail-m_7209538006811084840gmail-tok-nf">pick</span><span class="m_293122381163732460gmail-m_7209538006811084840gmail-tok-p">(</span><span class="m_293122381163732460gmail-m_7209538006811084840gmail-tok-nn">proper_types</span><span class="m_293122381163732460gmail-m_7209538006811084840gmail-tok-p">:</span><span class="m_293122381163732460gmail-m_7209538006811084840gmail-tok-nf">term</span><span class="m_293122381163732460gmail-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><div>I see the same behaviour for <br><br>proper_gen:pick(proper_types:range(0,16#10ffff)).<br><br></div><div>which I believe is equivalent.<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</div><br></div><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_293122381163732460m_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_293122381163732460m_7209538006811084840gmail-tok-nn"><br>proper_gen</span><span class="m_293122381163732460m_7209538006811084840gmail-tok-p">:</span><span class="m_293122381163732460m_7209538006811084840gmail-tok-nf">pick</span><span class="m_293122381163732460m_7209538006811084840gmail-tok-p">(</span><span class="m_293122381163732460m_7209538006811084840gmail-tok-nn">proper_types</span><span class="m_293122381163732460m_7209538006811084840gmail-tok-p">:</span><span class="m_293122381163732460m_7209538006811084840gmail-tok-nf">term</span><span class="m_293122381163732460m_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>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div>