gen.filter with discards (maxDiscards, Report.discarded) #9
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Missing
gen.filter pred gand a notion of discard in the runner (maxDiscards,Report.discarded).Why
Every framework has a retrying filter (Hedgehog
Gen.filter, QuickChecksuchThat, Hypothesis.filter, fast-check.filter). Without it callers hand-rollmaptricks that distort the distribution. Two upcoming needs:gen.attrsOf: drop-duplicates is the fallback; retrying is what HedgehogGen.mapdoes to hit the drawn size.gen.float: "edge values inside the range" is a filter.Suggested shape
ntries and signal a discard.nullin an{ ok; value }wrapper) the runner recognises; discarded cases do not count towardtests.checktakesmaxDiscards(default ~tests * 10like QuickCheck's ratio) and reportsdiscarded.Tree.filter).Implemented in
c826d84, pushed to main.