[darcs-devel] [patch1979] better shrinking for patches
Ganesh Sittampalam
bugs at darcs.net
Mon Feb 24 18:18:11 UTC 2020
Ganesh Sittampalam <ganesh at earth.li> added the comment:
On 24/02/2020 13:01, Ben Franksen wrote:
> I think I understand now, thanks for the explanation. So we drop one
> patch from e.g. the head of the sequence. If that fails the test, QC
> will try to further shrink that sequence, etc. If they all fail, then it
> will finally try NilFL. But if one doesn't we'll be stuck. If this is
> so, then shrinking a sequence with something like 'reverse . tailsFL' in
> one go looks like an easy improvement.
Note it's only a clear improvement if dropping one element doesn't help
but dropping two does.
It could also slow down shrinking substantially if most shrinks don't
work (i.e. the test succeeds after shrinking). The instance for normal
lists tries dividing the list in 2, 4, 8 etc as well as removing each
individual element:
https://hackage.haskell.org/package/QuickCheck-2.13.2/docs/src/Test.QuickCheck.Arbitrary.html#shrinkList
__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/patch1979>
__________________________________
More information about the darcs-devel
mailing list