more automatic tests for containers

wren ng thornton wren at freegeek.org
Sun Jan 8 23:29:32 CET 2012


On 12/22/11 9:35 PM, John Alfred Nathanael Chee wrote:
> On Wed, Dec 21, 2011 at 15:20, Joachim Breitner
> <mail at joachim-breitner.de>  wrote:
>> 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.

I definitely prefer the "==" form for stating laws the interface follows.

Doctest came from the Python tradition, which is a very imperative 
outlook on life. I wonder whether doctest could be modified to better 
match the programming, documentation, and testing style of Haskell. In 
particular, I'd expect it to recognize "=="-style statements as things 
to test. The only real issue is whether those statements should be 
considered unit tests or properties (testable by QuickCheck and 
SmallCheck), since those two categories have very different methods of 
being verified.

-- 
Live well,
~wren



More information about the Libraries mailing list