Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define showDefaultValue for QuickCheckTests, QuickCheckMaxSize and QuickCheckMaxRatio #428

Merged
merged 1 commit into from
Sep 1, 2024

Conversation

Bodigrim
Copy link
Collaborator

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)

…ickCheckMaxRatio

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
Copy link
Collaborator Author

Bodigrim commented Sep 1, 2024

Also CC @martijnbastiaan for review.

Copy link
Contributor

@martijnbastiaan martijnbastiaan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice!

@Bodigrim Bodigrim merged commit 36f3c2e into master Sep 1, 2024
14 checks passed
@Bodigrim Bodigrim deleted the show-quickcheck-defaults branch September 1, 2024 21:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants