UnkindPartition / tasty

Modern and extensible testing framework for Haskell
640 stars 110 forks source link

Define showDefaultValue for QuickCheckTests, QuickCheckMaxSize and QuickCheckMaxRatio #428

Closed Bodigrim closed 2 months ago

Bodigrim commented 3 months ago

Taking inspiration from #427, let's define showDefaultValue for QuickCheckTests, QuickCheckMaxSize and QuickCheckMaxRatio.

Note that showDefaultValue for QuickCheckMaxShrinks is consciously omitted, because it is equal to maxBound :: Int, which looks too puzzling in --help.

Before:

Available options:
  ...
  --quickcheck-tests NUMBER
                           Number of test cases for QuickCheck to generate.
                           Underscores accepted: e.g. 10_000_000
  --quickcheck-replay SEED Random seed to use for replaying a previous test run
  --quickcheck-show-replay Show a replay token for replaying tests
  --quickcheck-max-size NUMBER
                           Size of the biggest test cases quickcheck generates
  --quickcheck-max-ratio NUMBER
                           Maximum number of discared tests per successful test
                           before giving up
  --quickcheck-verbose     Show the generated test cases
  --quickcheck-shrinks NUMBER
                           Number of shrinks allowed before QuickCheck will fail
                           a test

After:

Available options:
  ...
  --quickcheck-tests NUMBER
                           Number of test cases for QuickCheck to generate.
                           Underscores accepted: e.g. 10_000_000 (default: 100)
  --quickcheck-replay SEED Random seed to use for replaying a previous test run
  --quickcheck-show-replay Show a replay token for replaying tests
  --quickcheck-max-size NUMBER
                           Size of the biggest test cases quickcheck generates
                           (default: 100)
  --quickcheck-max-ratio NUMBER
                           Maximum number of discared tests per successful test
                           before giving up (default: 10)
  --quickcheck-verbose     Show the generated test cases
  --quickcheck-shrinks NUMBER
                           Number of shrinks allowed before QuickCheck will fail
                           a test
  --quickcheck-timeout DURATION
                           Timeout for individual tests within a QuickCheck
                           property (suffixes: ms,s,m,h; default: s)
Bodigrim commented 2 months ago

Also CC @martijnbastiaan for review.