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

Initial options #427

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

Conversation

phadej
Copy link
Contributor

@phadej phadej commented Aug 13, 2024

It turns out tasty very much had all building blocks to allow specifying initial option set.
This may solve #414

This PR is a draft, I'd welcome if anyone takes over as I did the least possible as a proof-of-concept (no haddocks for example).

The options-example "test-suite" is a demo.

cabal run options-example -- --help prints

  --quickcheck-tests NUMBER
                           Number of test cases for QuickCheck to generate.
                           Underscores accepted: e.g. 10_000_000 (default: 1000)

(I made default value visible).

and if you run test the output is

options-example
  assoc: OK
    +++ OK, passed 1000 tests.

so the value is actually used. But it can still be overridden with --quickcheck-tests: cabal run options-example -- --quickcheck-tests 1234

options-example
  assoc: OK
    +++ OK, passed 1234 tests.

This patch is done on 10% Well-Typed time.

@Bodigrim
Copy link
Collaborator

Bodigrim commented Sep 1, 2024

This looks a reasonable way to address the problem in #414, but I'm extremely cautious to extend API beyond absolutely necessary. I'd like to hear from other maintainers.

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