October 19, 2011 Re: How do you use templates in D? | ||||
|---|---|---|---|---|
| ||||
On Wed, 19 Oct 2011 08:18:02 +0200, Andrew Pennebaker <andrew.pennebaker@gmail.com> wrote: > 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? > > Cheers, > Yes it can. > Andrew Pennebaker > www.yellosoft.us > > On Tue, Oct 18, 2011 at 11:14 PM, Martin Nowak <dawg@dawgfoto.de> wrote: > >> On Tue, 18 Oct 2011 21:17:56 +0200, bearophile <bearophileHUGS@lycos.com> >> wrote: >> >> Andrew Pennebaker: >>> >>> The D version will be called dashcheck<https://github.com/** >>>> mcandre/dashcheck <https://github.com/mcandre/dashcheck>> >>>> >>> >>> QuickCheck is one of the good things of Haskell. >>> >>> I have raised the topic few times: >>> http://www.digitalmars.com/d/**archives/digitalmars/D/** >>> QuickCheck-like_in_Phobos_**131256.html<http://www.digitalmars.com/d/archives/digitalmars/D/QuickCheck-like_in_Phobos_131256.html> >>> http://www.digitalmars.com/d/**archives/digitalmars/D/Re_** >>> Unit_Testing_for_D_._72154.**html<http://www.digitalmars.com/d/archives/digitalmars/D/Re_Unit_Testing_for_D_._72154.html> >>> >>> 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: >>> http://www.digitalmars.com/**webnews/newsgroups.php?art_** >>> group=digitalmars.D&article_**id=73949<http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=73949> >>> >>> Bye, >>> bearophile >>> >> >> I wrote a pretty complete port of Haskell's Quickcheck some month ago. >> https://github.com/dawgfoto/**qcheck <https://github.com/dawgfoto/qcheck> >> The main function quickcheck takes the testee as first template parameter >> and a bunch of policies. It will use getArbitraryTuple to construct the >> parameters >> of the testee. It should be able to construct a random instance of any type >> out of the box, >> but you can also pass generators with the policies and they will be used >> instead. >> There is also a Policy RandomizeMembers which will set aggregate members to >> random values >> after construction. >> The testee might return a boolean result or an enum QCheckResult which has >> a third entry >> QCheckResult.Reject. >> >> martin | ||||
October 19, 2011 Re: How do you use templates in D? | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Martin Nowak | Martin Nowak:
> I wrote a pretty complete port of Haskell's Quickcheck some month ago. https://github.com/dawgfoto/qcheck
Once a Quickcheck-like library is well developed and well used, it will be fit to be added to Phobos.
Bye,
bearophile
| |||
October 19, 2011 Re: How do you use templates in D? | ||||
|---|---|---|---|---|
| ||||
Attachments:
| Nowak, what's the command to install a D package?
Cheers,
Andrew Pennebaker
www.yellosoft.us
On Wed, Oct 19, 2011 at 5:17 AM, Martin Nowak <dawg@dawgfoto.de> wrote:
> On Wed, 19 Oct 2011 08:18:02 +0200, Andrew Pennebaker < andrew.pennebaker@gmail.com> wrote:
>
> 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?
>>
>> Cheers,
>>
>> Yes it can.
>
> Andrew Pennebaker
>> www.yellosoft.us
>>
>> On Tue, Oct 18, 2011 at 11:14 PM, Martin Nowak <dawg@dawgfoto.de> wrote:
>>
>> On Tue, 18 Oct 2011 21:17:56 +0200, bearophile <bearophileHUGS@lycos.com
>>> >
>>> wrote:
>>>
>>> Andrew Pennebaker:
>>>
>>>>
>>>> The D version will be called dashcheck<https://github.com/****<https://github.com/**>
>>>>
>>>>> mcandre/dashcheck <https://github.com/mcandre/**dashcheck<https://github.com/mcandre/dashcheck>
>>>>> >>
>>>>>
>>>>>
>>>> QuickCheck is one of the good things of Haskell.
>>>>
>>>> I have raised the topic few times: http://www.digitalmars.com/d/****archives/digitalmars/D/**<http://www.digitalmars.com/d/**archives/digitalmars/D/**> QuickCheck-like_in_Phobos_****131256.html<http://www.** digitalmars.com/d/archives/**digitalmars/D/QuickCheck-like_** in_Phobos_131256.html<http://www.digitalmars.com/d/archives/digitalmars/D/QuickCheck-like_in_Phobos_131256.html>
>>>> >
>>>> http://www.digitalmars.com/d/****archives/digitalmars/D/Re_**<http://www.digitalmars.com/d/**archives/digitalmars/D/Re_**>
>>>> Unit_Testing_for_D_._72154.****html<http://www.digitalmars.**
>>>> com/d/archives/digitalmars/D/**Re_Unit_Testing_for_D_._72154.**html<http://www.digitalmars.com/d/archives/digitalmars/D/Re_Unit_Testing_for_D_._72154.html>
>>>> >
>>>>
>>>>
>>>> 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:
>>>> http://www.digitalmars.com/****webnews/newsgroups.php?art_**<http://www.digitalmars.com/**webnews/newsgroups.php?art_**>
>>>> group=digitalmars.D&article_****id=73949<http://www.**
>>>> digitalmars.com/webnews/**newsgroups.php?art_group=**
>>>> digitalmars.D&article_id=73949<http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=73949>
>>>> **>
>>>>
>>>> Bye,
>>>> bearophile
>>>>
>>>>
>>> I wrote a pretty complete port of Haskell's Quickcheck some month ago. https://github.com/dawgfoto/****qcheck<https://github.com/dawgfoto/**qcheck>< https://github.com/dawgfoto/**qcheck<https://github.com/dawgfoto/qcheck>
>>> >
>>>
>>> The main function quickcheck takes the testee as first template parameter
>>> and a bunch of policies. It will use getArbitraryTuple to construct the
>>> parameters
>>> of the testee. It should be able to construct a random instance of any
>>> type
>>> out of the box,
>>> but you can also pass generators with the policies and they will be used
>>> instead.
>>> There is also a Policy RandomizeMembers which will set aggregate members
>>> to
>>> random values
>>> after construction.
>>> The testee might return a boolean result or an enum QCheckResult which
>>> has
>>> a third entry
>>> QCheckResult.Reject.
>>>
>>> martin
>>>
>>
| |||
October 19, 2011 Re: How do you use templates in D? | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Martin Nowak | Am 19.10.2011, 05:14 Uhr, schrieb Martin Nowak <dawg@dawgfoto.de>:
> On Tue, 18 Oct 2011 21:17:56 +0200, bearophile <bearophileHUGS@lycos.com> wrote:
>
>> Andrew Pennebaker:
>>
>>> The D version will be called dashcheck<https://github.com/mcandre/dashcheck>
>>
>> QuickCheck is one of the good things of Haskell.
>>
>> I have raised the topic few times:
>> http://www.digitalmars.com/d/archives/digitalmars/D/QuickCheck-like_in_Phobos_131256.html
>> http://www.digitalmars.com/d/archives/digitalmars/D/Re_Unit_Testing_for_D_._72154.html
>>
>> 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:
>> http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=73949
>>
>> Bye,
>> bearophile
>
> I wrote a pretty complete port of Haskell's Quickcheck some month ago.
> https://github.com/dawgfoto/qcheck
> The main function quickcheck takes the testee as first template parameter
> and a bunch of policies. It will use getArbitraryTuple to construct the parameters
> of the testee. It should be able to construct a random instance of any type out of the box,
> but you can also pass generators with the policies and they will be used instead.
> There is also a Policy RandomizeMembers which will set aggregate members to random values
> after construction.
> The testee might return a boolean result or an enum QCheckResult which has a third entry
> QCheckResult.Reject.
>
> martin
There is a lot of nice code floating around. I wish there was a place where Andrew and others would have easily found your work under tags like "QuickCheck", "Haskel" and "unit test". Some website with a package manager that can also check if my checked out version of the code is still up-to-date or if there are updates and new features. It doesn't matter if the 'package' is marked as experimental.
Sometimes you just get an idea for a library and want to see if someone is already working on it. Or you just browse the available packages for D to get some inspiration on topics like unit testing, serialization or web frameworks.
| |||
October 19, 2011 Re: How do you use templates in D? | ||||
|---|---|---|---|---|
| ||||
Posted in reply to Marco Leise Attachments:
| Ah, RTest is still online, but it's part of a larger project called blip<https://github.com/fawzi/blip>. Fawzi would like help updating RTest to D 2.0. Cheers, Andrew Pennebaker www.yellosoft.us On Wed, Oct 19, 2011 at 2:51 PM, Marco Leise <Marco.Leise@gmx.de> wrote: > Am 19.10.2011, 05:14 Uhr, schrieb Martin Nowak <dawg@dawgfoto.de>: > > On Tue, 18 Oct 2011 21:17:56 +0200, bearophile <bearophileHUGS@lycos.com> >> wrote: >> >> Andrew Pennebaker: >>> >>> The D version will be called dashcheck<https://github.com/** >>>> mcandre/dashcheck <https://github.com/mcandre/dashcheck>> >>>> >>> >>> QuickCheck is one of the good things of Haskell. >>> >>> I have raised the topic few times: >>> http://www.digitalmars.com/d/**archives/digitalmars/D/** >>> QuickCheck-like_in_Phobos_**131256.html<http://www.digitalmars.com/d/archives/digitalmars/D/QuickCheck-like_in_Phobos_131256.html> >>> http://www.digitalmars.com/d/**archives/digitalmars/D/Re_** >>> Unit_Testing_for_D_._72154.**html<http://www.digitalmars.com/d/archives/digitalmars/D/Re_Unit_Testing_for_D_._72154.html> >>> >>> 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: >>> http://www.digitalmars.com/**webnews/newsgroups.php?art_** >>> group=digitalmars.D&article_**id=73949<http://www.digitalmars.com/webnews/newsgroups.php?art_group=digitalmars.D&article_id=73949> >>> >>> Bye, >>> bearophile >>> >> >> I wrote a pretty complete port of Haskell's Quickcheck some month ago. >> https://github.com/dawgfoto/**qcheck <https://github.com/dawgfoto/qcheck> >> The main function quickcheck takes the testee as first template parameter >> and a bunch of policies. It will use getArbitraryTuple to construct the >> parameters >> of the testee. It should be able to construct a random instance of any >> type out of the box, >> but you can also pass generators with the policies and they will be used >> instead. >> There is also a Policy RandomizeMembers which will set aggregate members >> to random values >> after construction. >> The testee might return a boolean result or an enum QCheckResult which has >> a third entry >> QCheckResult.Reject. >> >> martin >> > > There is a lot of nice code floating around. I wish there was a place where > Andrew and others would have easily found your work under tags like > "QuickCheck", "Haskel" and "unit test". Some website with a package manager > that can also check if my checked out version of the code is still > up-to-date or if there are updates and new features. It doesn't matter if > the 'package' is marked as experimental. > Sometimes you just get an idea for a library and want to see if someone is > already working on it. Or you just browse the available packages for D to > get some inspiration on topics like unit testing, serialization or web > frameworks. > | |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply