I am writing a library named wumpus
(say). wumpus
does many amazing things.
There are potentially many ways to interact with wumpus
. I have thus decided to put its JSON ability in a separate package, wumpus-json
, as not all wumpus
users will want the dependencies required for the JSON interface.
I would like to test that wumpus
operates correctly. I thus have a testsuite for wumpus
. It includes some definitions and some tests over those definitions. I would like to run similar tests for the JSON interface to wumpus
.
But now I am stuck. It seems I cannot have the wumpus
testsuite depend on wumpus-json
, as Cabal thinks that’s a circular dependency. (It’s not: the wumpus
testsuite depends on wumpus-json
depends on the wumpus
library. It’s perhaps U-shaped, but it’s not a closed circle.) And I do not wish to put the tests into wumpus-json
's testsuite, because then I have to repeat a bunch of definitions (that I cannot export from wumpus
's testsuite). I could move all my tests to wumpus-json
, but then poor wumpus
is left without a testsuite (and I will also have a problem when I want wumpus-csv
). Maybe I make a wumpus-tests
that depends on them all? That seems a bit overwrought.
Does the wisdom of the crowd have any insight to offer to get me unstuck? Thanks!