more automatic tests for containers

Kazu Yamamoto ( 山本和彦 ) kazu at iij.ad.jp
Wed Dec 21 05:31:21 CET 2011


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.

  Note that I'm not sure how to specify errors with doctest at this
  moment.

2) test-framework-th

   If we replace "test_" with "case_", we can use test-framework-th to
   generate the long list of test cases. We don't need to update it when
   we add "prop_" and "case_".

   We can specify the number of QuickCheck test as follows:

   runghc -i.. -DTESTING map-properties.hs --maximum-generated-tests=500

Since this is test stuff, we don't have to add doctest and
test-framework-th to containers.cabal.

What do you think? If you like this, I will work and send you pull
request.

--Kazu



More information about the Libraries mailing list