I decided to give #23 a try. So far the two main drawbacks I see is the lack of support for generating functions (there is no analogue of Coarbitrary) and having to explicitly universally quantify with property $ do { a <- forAll genA; ... } instead of defining a property with arguments (though I'm like 80% sure this can be solved with some fancy typeclassing and type families a la printf, it just caught me in a very 1AM point of my life)
WIP: migrate from QuickCheck to Hedgehog #32
VojtechStep/mikan:feature/hedgehog into main
I'll take a look at https://dl.acm.org/doi/pdf/10.1145/2430532.2364516 for function generation and see how annoying it is without typeclasses, to keep in line with the way hedgehog does things
It is tempting to do some typeclass trickery, but it plays out rather poorly. Property testing is extremely sensitive to the distributions you choose on the inputs, and classes like Arbitrary funnel you down a path where there’s a single blessed distribution per type. This is why I suggested moving to hedgehog in the first place; there’s much finer grained tools for doing per-test case generators.
What I had in mind was purely code shuffling, something that would turn a MonadTest m => a -> b -> ... -> m () into a Gen a -> Gen b -> ... -> Property. That would handle the quantification for you while still giving you complete control over the distributions. I just want to reduce the boilerplate visible in Internal.Utils.VarSet
c8deaa5539
d00319a28f
d00319a28f
4193aa47cf
4193aa47cf
to 1eeb37bf22
1eeb37bf22
7e722a1e33
7e722a1e33
5896e88ad2
There's an existing function generation library for Hedgehog (https://hackage.haskell.org/package/hedgehog-fn), but it seems to be lacking in instances. As far as I understand there's no reason not to use a typeclass for "Coarbitrary" because it doesn't affect the distribution of the function generation, though I guess it could affect the shrinking behavior.
5896e88ad2
4877c29d30
d413334ee2
99d7bac604
- test/Main.hs
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.
No due date set.
No dependencies set.
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?