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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃懛馃摎馃[feature/issues/107] Shrinker for Ptr generator #108

Merged
merged 1 commit into from
May 18, 2023

Conversation

steffnova
Copy link
Owner

[Problem]

However Ptr doesn't provide shrinker that can shrink pointer to nil. (it only shrinks the value that it points to).

[Solution]

Add Ptr shrinker. Ptr shrinker treats value that it points as an element. This allows usage of CollectionSizeRemoveFront and CollectionElementOne shrinkers to be used to compose Ptr shrinker.

Ptr and PtrTo have been merged into Ptr generator.

Add constraints.Ptr to control generation of nil values. Add arbitrary.NewPtr function that builds pointer from arbitrary.

[Test]
Update tests to reflect removal of PtrTo generator Add tests for Ptr shrinker

[Docs]
Update documentation for Ptr generator and it's examples

[Note]
Examples for weighted and recursive generator have been updated as well because Ptr generator used int these tests now generates different values

Close #107

[Problem]

However Ptr doesn't provide shrinker that can shrink pointer to nil.
(it only shrinks the value that it points to).

[Solution]

Add Ptr shrinker. Ptr shrinker treats value that it points as an element.
This allows usage of CollectionSizeRemoveFront and CollectionElementOne
shrinkers to be used to compose Ptr shrinker.

Ptr and PtrTo have been merged into Ptr generator.

Add constraints.Ptr to control generation of nil values.
Add arbitrary.NewPtr function that builds pointer from arbitrary.

[Test]
Update tests to reflect removal of PtrTo generator
Add tests for Ptr shrinker

[Docs]
Update documentation for Ptr generator and it's examples

[Note]
Examples for weighted and recursive generator have been updated as well
because Ptr generator used int these tests now generates different values

Close #107
@steffnova steffnova added the enhancement New feature or request label May 18, 2023
@steffnova steffnova self-assigned this May 18, 2023
@steffnova steffnova merged commit 2d94371 into main May 18, 2023
1 check passed
@steffnova steffnova deleted the feature/issues/107 branch May 23, 2023 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generator for pointers (PtrTo and Ptr) do not shrink pointer to nil
1 participant