These functions were added way back in the day to share work between a
group of predicates. That functionality was dropped in 2017 when
bound threads were implemented and running all tests began to require
IO (#157) - confusingly, the comment about sharing work was kept for 5
more years (until #362).
hunit-dejafu has very similar functions, and I wanted to make the APIs
of both packages identical so far as possible. HUnit supports
nameless test groups. Tasty does not. To keep the API the same as
hunit-dejafu, I filled in a default group name: "Deja Fu Tests".
But an unchangeable name isn't conducive to good testsuite output, and
it's time to fix that mistake.
I considered deprecating these functions instead, but they're not
really causing any problems as such, so there's no harm in keeping
them.
Fixes#361
The `testDejafus` functions in hunit-dejafu and tasty-dejafu say that
they share work. This isn't true, and actually hasn't been true since
discard functions were introduced in 2017 by db95dde, since that
commit removed the sharing of traces.
With careful application of typeclass instances to this GADT, and by
redefining 'ConcT' in terms of it, this solves the type inference
problem and removes the need for the 'basic' function. This approach
also has less newtype wrapping/unwrapping, and so is probably a step
in the right direction even without the type inference advantages.
The diff is quite big because things have needed to migrate between
modules to avoid the import graph getting even worse.
The 'Program' is the new formulation of dejafu unit tests. A
'Program' is one of three types:
- A 'ConcT', which is as before.
- A 'WithSetup', which corresponds to 'dontCheck'.
- A 'WithSetupAndTeardown', which corresponds to 'subconcurrency'.
This more new formulation makes it impossible to nest 'withSetup' (the
replacement for 'dontCheck') or 'withSetupAndTeardown' (the
half-replacement for 'subconcurrency'), by as these functions take a
'ConcT' as their argument and produce a 'Program WithSetup' or
'Program WithSetupAndTeardown'.
The testing functions have all been generalised to work with this
'Program' type.