Nowak, what's the command to install a D package?<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 Wed, Oct 19, 2011 at 5:17 AM, 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 class="im">On Wed, 19 Oct 2011 08:18:02 +0200, Andrew Pennebaker <<a href="mailto:andrew.pennebaker@gmail.com" target="_blank">andrew.pennebaker@gmail.com</a>> wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Novak: Very cool. Can qcheck automatically figure out a way to generate the<br>
arbitrary data types needed as input for the property/testee? Or did I read<br>
that wrong?<br>
<br>
Cheers,<br>
<br>
</blockquote></div>
Yes it can.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
Andrew Pennebaker<br>
<a href="http://www.yellosoft.us" target="_blank">www.yellosoft.us</a><br>
<br>
On Tue, Oct 18, 2011 at 11:14 PM, Martin Nowak <<a href="mailto:dawg@dawgfoto.de" target="_blank">dawg@dawgfoto.de</a>> wrote:<br>
<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
On Tue, 18 Oct 2011 21:17:56 +0200, bearophile <<a href="mailto:bearophileHUGS@lycos.com" target="_blank">bearophileHUGS@lycos.com</a>><br>
wrote:<br>
<br>
 Andrew Pennebaker:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
 The D version will be called dashcheck<<a href="https://github.com/**" target="_blank">https://github.com/*<u></u>*</a><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
mcandre/dashcheck <<a href="https://github.com/mcandre/dashcheck" target="_blank">https://github.com/mcandre/<u></u>dashcheck</a>>><br>
<br>
</blockquote><div class="im">
<br>
QuickCheck is one of the good things of Haskell.<br>
<br>
I have raised the topic few times:<br>
</div><a href="http://www.digitalmars.com/d/**archives/digitalmars/D/**" target="_blank">http://www.digitalmars.com/d/*<u></u>*archives/digitalmars/D/**</a><br>
QuickCheck-like_in_Phobos_**<u></u>131256.html<<a href="http://www.digitalmars.com/d/archives/digitalmars/D/QuickCheck-like_in_Phobos_131256.html" target="_blank">http://www.<u></u>digitalmars.com/d/archives/<u></u>digitalmars/D/QuickCheck-like_<u></u>in_Phobos_131256.html</a>><br>


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

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


<br>
Bye,<br>
bearophile<br>
<br>
</blockquote><div class="im">
<br>
I wrote a pretty complete port of Haskell's Quickcheck some month ago.<br>
</div><a href="https://github.com/dawgfoto/**qcheck" target="_blank">https://github.com/dawgfoto/**<u></u>qcheck</a> <<a href="https://github.com/dawgfoto/qcheck" target="_blank">https://github.com/dawgfoto/<u></u>qcheck</a>><div class="im">

<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<br>
parameters<br>
of the testee. It should be able to construct a random instance of any type<br>
out of the box,<br>
but you can also pass generators with the policies and they will be used<br>
instead.<br>
There is also a Policy RandomizeMembers which will set aggregate members to<br>
random values<br>
after construction.<br>
The testee might return a boolean result or an enum QCheckResult which has<br>
a third entry<br>
QCheckResult.Reject.<br>
<br>
martin<br>
</div></blockquote></blockquote>
</blockquote></div><br>