Novak: Very cool. Can qcheck automatically figure out a way to generate the arbitrary data types needed as input for the property/testee? Or did I read that wrong?<br clear="all"><div><br></div>Cheers,<div><br></div><div>Andrew Pennebaker</div>

<div><a href="http://www.yellosoft.us" target="_blank">www.yellosoft.us</a></div><br><div class="gmail_quote">On Tue, Oct 18, 2011 at 11:14 PM, Martin Nowak <span dir="ltr"><<a href="mailto:dawg@dawgfoto.de">dawg@dawgfoto.de</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div></div><div class="h5">On Tue, 18 Oct 2011 21:17:56 +0200, bearophile <<a href="mailto:bearophileHUGS@lycos.com" target="_blank">bearophileHUGS@lycos.com</a>> wrote:<br>


<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Andrew Pennebaker:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
The D version will be called dashcheck<<a href="https://github.com/mcandre/dashcheck" target="_blank">https://github.com/<u></u>mcandre/dashcheck</a>><br>
</blockquote>
<br>
QuickCheck is one of the good things of Haskell.<br>
<br>
I have raised the topic few times:<br>
<a href="http://www.digitalmars.com/d/archives/digitalmars/D/QuickCheck-like_in_Phobos_131256.html" target="_blank">http://www.digitalmars.com/d/<u></u>archives/digitalmars/D/<u></u>QuickCheck-like_in_Phobos_<u></u>131256.html</a><br>


<a href="http://www.digitalmars.com/d/archives/digitalmars/D/Re_Unit_Testing_for_D_._72154.html" target="_blank">http://www.digitalmars.com/d/<u></u>archives/digitalmars/D/Re_<u></u>Unit_Testing_for_D_._72154.<u></u>html</a><br>


<br>
I remember someone has already written one or two D versions of QuickCheck-like (probably D1), but it didn't get a lot of interest in the D newsgroups. One of them:<br>
<a href="http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=73949" target="_blank">http://www.digitalmars.com/<u></u>webnews/newsgroups.php?art_<u></u>group=digitalmars.D&article_<u></u>id=73949</a><br>


<br>
Bye,<br>
bearophile<br>
</blockquote>
<br></div></div>
I wrote a pretty complete port of Haskell's Quickcheck some month ago.<br>
<a href="https://github.com/dawgfoto/qcheck" target="_blank">https://github.com/dawgfoto/<u></u>qcheck</a><br>
The main function quickcheck takes the testee as first template parameter<br>
and a bunch of policies. It will use getArbitraryTuple to construct the parameters<br>
of the testee. It should be able to construct a random instance of any type out of the box,<br>
but you can also pass generators with the policies and they will be used instead.<br>
There is also a Policy RandomizeMembers which will set aggregate members to random values<br>
after construction.<br>
The testee might return a boolean result or an enum QCheckResult which has a third entry<br>
QCheckResult.Reject.<br><font color="#888888">
<br>
martin<br>
</font></blockquote></div><br>