more automatic tests for containers

John Alfred Nathanael Chee cheecheeo at gmail.com
Fri Dec 23 03:35:09 CET 2011


On Wed, Dec 21, 2011 at 15:20, Joachim Breitner
<mail at joachim-breitner.de> wrote:
> Hi,
>
> Am Mittwoch, den 21.12.2011, 13:31 +0900 schrieb Kazu Yamamoto:
>> Especially to Johan and Milan,
>>
>> I'm thinking to introduce more automatic tests for the containers
>> library. Let's take Data.Map as example:
>>
>> 1) doctest
>>
>>   Some haddoc documents include the following style.
>>
>>   -- > Data.Map.null (empty) == True
>>
>>   If we modify it like
>>
>>   -- >>> Data.Map.null (empty)
>>   -- True
>>
>>   we can use doctest. And we can remove corresponding unit test
>>   from test/*-properties.hs.
>
> I’m not sure what the benefit is here. containers is a “high profile”
> library which sees lots of effort. Introducing a new testing library
> (doctest) just to avoid having to add those test cases to the test suite
> does not seem to gain much, but takes away some flexibility while
> writing good documentation. Maybe the “==” form is more readable to some
> users?

Consistent unit tests and documentation seems like a nice benefit to
me (don't forget about modifying and deleting unit tests). However, I
agree that the structure imposed by doctest might lead to less than
tasteful documentation.

-- 
Love in Jesus Christ, John Alfred Nathanael Chee
http://www.biblegateway.com/
http://web.cecs.pdx.edu/~chee/



More information about the Libraries mailing list