more automatic tests for containers
Kazu Yamamoto ( 山本和彦 )
kazu at iij.ad.jp
Mon Dec 26 04:19:28 CET 2011
> 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 agree.
I should implement document test which evaluates examples of Data.Map
(for instance) directly:
----
insert 5 'x' (fromList [(5,'a'), (3,'b')]) == fromList [(3, 'b'), (5, 'x')]
insert 7 'x' (fromList [(5,'a'), (3,'b')]) == fromList [(3, 'b'), (5, 'a'), (7, 'x')]
insert 5 'x' empty == singleton 5 'x'
----
And sees if they return True.
--Kazu
More information about the Libraries
mailing list