[darcs-devel] [patch1988] massive boilerplate reduction in test harness

Ben Franksen bugs at darcs.net
Sun Feb 16 20:45:37 UTC 2020


Ben Franksen <ben.franksen at online.de> added the comment:

An updated patch, rebased, with improved description and w/o the removal of
class ArbitraryStateIn.

1 patch for repository http://darcs.net/screened:

patch 26ffb61437f21157b4fac3e55c841cf152559f40
Author: Ben Franksen <ben.franksen at online.de>
Date:   Sun Feb 16 09:53:32 CET 2020
  * massive boilerplate reduction in test harness
  
  This patch makes a number of invasive refactors in the test harness that
  dramatically reduce the boilerplate of repeated instance Arbitrary
  definitions. Here are the main ideas:
  
  First, remove all instances for Sealed patches and keep only the ones for
  Sealed2 patches. The generators and infrastructure have been refactored to
  always take and generate Sealed2 patches. This has the beneficial
  side-effect of cleaning up a lot of the types in the testing infrastructure.
  
  For most of the remaining Arbitrary instances we can provide a single
  generic instance. To make this possible we need to use the generic model
  generator (aSmallRepo from the RepoModel class), which we always do except
  for the RepoPatchV1 tests. My solution for this was to move all the
  RepoPatchV1 tests into a separate module and throw out the tests that are
  disabled for RepoPatchV1 anyway. Even with this out of the way, I needed to
  refactor WithState and the class ArbitraryState to no longer take the
  model/state as parameter, but rather use the type function ModelOf. This,
  too, make the types simpler and signatures less verbose.
  
  Additional minor cleanups:
  - The TestGenerator/TestCondition/TestCheck machinery now lives in the
    D.T.Patch.Utils module.
  - Generalize qc_prim32/3 to qc_named_prim.
  - Removed some redundant constraints.
  - Renamed Darcs.Test.Util.TestResult.fromMaybe to avoid collision with the
    well known Data.Maybe.fromMaybe
  - Allow all darcs-lib extensions for darcs-test, too; cleanup module-local
    extension pragmas.

__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/patch1988>
__________________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch-preview.txt
Type: text/x-darcs-patch
Size: 66480 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/darcs-devel/attachments/20200216/f154e9a6/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: massive-boilerplate-reduction-in-test-harness.dpatch
Type: application/x-darcs-patch
Size: 84944 bytes
Desc: not available
URL: <http://lists.osuosl.org/pipermail/darcs-devel/attachments/20200216/f154e9a6/attachment-0003.bin>
-------------- next part --------------
.





More information about the darcs-devel mailing list