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

Shrinking for constrained-generators #4229

Merged
merged 1 commit into from
Apr 11, 2024
Merged

Conversation

MaximilianAlgehed
Copy link
Collaborator

Description

This implements shrinking for constrained-generators by embedding it in the HasSpec class. There are still some TODOs that need to be covered but this should be relatively ready to look at.

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated
  • When applicable, versions are updated in .cabal and CHANGELOG.md files according to the
    versioning process.
  • The version bounds in .cabal files for all affected packages are updated. If you change the bounds in a cabal file, that package itself must have a version increase. (See RELEASING.md)
  • All visible changes are prepended to the latest section of a CHANGELOG.md for the affected packages. New section is never added with the code changes. (See RELEASING.md)
  • Code is formatted with fourmolu (use scripts/fourmolize.sh)
  • Cabal files are formatted (use scripts/cabal-format.sh)
  • hie.yaml has been updated (use scripts/gen-hie.sh)
  • Self-reviewed the diff

@MaximilianAlgehed MaximilianAlgehed marked this pull request as draft April 2, 2024 14:30
@MaximilianAlgehed
Copy link
Collaborator Author

It might be interesting for @Soupstraw to also have a look at this. Not required but spreading knowledge around isn't a bad thing.

@MaximilianAlgehed MaximilianAlgehed marked this pull request as ready for review April 8, 2024 15:34
@MaximilianAlgehed MaximilianAlgehed force-pushed the PR-shrinking branch 2 times, most recently from 94e5afc to 859f5d2 Compare April 10, 2024 09:02
Copy link
Contributor

@Soupstraw Soupstraw left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@TimSheard TimSheard left a comment

Choose a reason for hiding this comment

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

This PR adds a new method to HasSpec, supplies the method for all the instances, and then adds some tests that the shrinking does not affect the results.

Just a few questions to answer. May be add some more comments.

@MaximilianAlgehed MaximilianAlgehed merged commit 9589f2c into master Apr 11, 2024
15 checks passed
@MaximilianAlgehed MaximilianAlgehed deleted the PR-shrinking branch April 11, 2024 12:10
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.

3 participants