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

Use the size_hint method of Arbitrary to more intelligently pick the input size. #2

Open
brson opened this issue Jan 18, 2024 · 2 comments

Comments

@brson
Copy link

brson commented Jan 18, 2024

Most users are going to use the default arb function, with an input size of 256; and in cases that is insufficent, will silently get low-quality test inputs because many/most Arbitrary impls allow short inputs, treating them as 0-padded up to the needed length (I think I recall this).

And picking the correct byte length to fully satisfy any particular Arbitrary impl, calling arb-sized is not really reasonable for most people.

The default method could more intellegently use the Arbitrary::size_hint method to pick an input size.

@leighmcculloch
Copy link

leighmcculloch commented Jan 18, 2024

+1 this seems like a good improvement. I don't see a reason not to do this.

@graydon wdyt?

@graydon
Copy link
Owner

graydon commented Jan 18, 2024

Oh, sure, seems plausible!

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

No branches or pull requests

3 participants