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

More sophisticated array shrink algorithm #15

Merged
merged 1 commit into from
Apr 7, 2024
Merged

Conversation

ohbarye
Copy link
Owner

@ohbarye ohbarye commented Apr 7, 2024

Change

This pull request polishes Array's shrink algorithm so that it can cover more cases.

I didn't choose a strategy to produce all combinations of items because it could be too large and takes so long time to get done. Instead, I chose a strategy to shrink each item of an array to reduce cases.

I referred https://github.com/dubzzz/fast-check/blob/9711e54a99784ee9acd321d675ceea558825e442/packages/fast-check/src/arbitrary/_internals/ArrayArbitrary.ts#L259-L325.

@@ -103,7 +103,7 @@ def printable_string(**kwargs)
end

def symbol(**kwargs)
array(one_of(*SYMBOL_SAFE_CHARS), **kwargs).map(SYMBOL_MAPPER, SYMBOL_UNMAPPER)
array(one_of(*SYMBOL_SAFE_CHARS), empty: false, **kwargs).map(SYMBOL_MAPPER, SYMBOL_UNMAPPER)
Copy link
Owner Author

Choose a reason for hiding this comment

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

Symbol basically should not be empty.

@ohbarye ohbarye merged commit b5689b4 into main Apr 7, 2024
3 checks passed
@ohbarye ohbarye deleted the powerful-array-shrink branch April 7, 2024 07:42
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.

1 participant