more automatic tests for containers

Kazu Yamamoto ( 山本和彦 ) kazu at iij.ad.jp
Wed Dec 28 02:20:43 CET 2011


Hello,

> 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.

The following hack to doctest enables that empty example results are
treated as True.

	https://github.com/kazu-yamamoto/doctest-haskell/commit/ab124abf6791870fd8f9de913f6a6fbaa8a2b18a

So, if we convert

-- > Data.Map.null (empty) == True

to

-- >>> Data.Map.null (empty) == True

the modified doctest can handle this example as test case.

If people like this approach, I will send a pull request to the author
of doctest and convert the examples of the containers library.

--Kazu



More information about the Libraries mailing list