Copyright | © 2018-2020 IOHK |
---|---|
License | Apache-2.0 |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Test.QuickCheck.Extra
Description
Extra helper functions for QuickCheck
Synopsis
- reasonablySized :: Gen a -> Gen a
Documentation
reasonablySized :: Gen a -> Gen a Source #
Resize a generator to grow with the size parameter, but remains reasonably sized. That is handy when testing on data-structures that can be arbitrarily large and, when large entities don't really bring any value to the test itself.
It uses a square root function which makes the size parameter grows quadratically slower than normal. That is,
Normal Size ----------- 0 1 10 100 1000 | Reasonable Size ---------------- 0 1 3 10 31 |