[darcs-devel] new test case generator

Ganesh Sittampalam ganesh at earth.li
Sun Jun 23 19:41:24 UTC 2019


On 23/06/2019 19:39, Ben Franksen wrote:
>> We really need shrinking. I think I'll just start implementing it for
>> the new generators.
> 
> I did that just now, wasn't as hard as I thought.
> 
> But it didn't help much. The failing test case remains nearly as
> complicated as it was.
> 
> My strategy was to use headPermutationsRL to generate a list of
> sequences from which I could then drop the last patch. This must then be
> done recursively and the sequences sorted according to their length.
> 
> What I could not do was to shrink the patches themselves. Changing a
> patch means we change the context of all the patches after it; we also
> may change its commute behavior with respect to other patches. I cannot
> see a way to make such shrinks in a consistent way over a whole sequence
> of patches, the more so if that sequence also contains conflictors.

I actually built some infrastructure for this, that was part of the idea
of having 'WithState' types I think.

The general principle being that if you shrink one patch, you change its
ending context and thus need to fixup the following patches based on
that change.

It looks like it was removed here:

patch 08d849355533569681363b5cc80aeed61aa878f9
Author: Iago Abal <iago.abal at gmail.com>
Date:   Fri Apr  1 12:07:51 GMT Summer Time 2011
  * Remove Darcs.Test.Patch.QuickCheck shrinker
  It is necessary to remove the shrinker in order to replace the old
RepoModel by the
  Darcs.Test.Patch.RepoModel one.
  NB: Ganesh will submit a new shrinker (RepoModel agnostic) briefly.

Sadly it doesn't seem like I ever did submit said new shrinker..still
maybe that old code has some ideas.

Ganesh



More information about the darcs-devel mailing list