cardano-wallet-test-utils-2020.12.8: Shared utilities for writing unit and property tests.
Copyright© 2018-2020 IOHK
LicenseApache-2.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

Test.QuickCheck.Extra

Description

Extra helper functions for QuickCheck

Synopsis

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 1000Reasonable Size ---------------- 0 1 3 10 31