
27 Dec
2011
27 Dec
'11
8:20 p.m.
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/ab124abf6791870fd8f9... 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