Open ckaran opened 4 years ago
Rather than global settings, I think a good solution would be to use the depth of the generator when determining length. Basically the deeper the value, the more likely the generated length will be on the lower end.
I plan on exploring something like this in the coming weeks.
Basically the deeper the value, the more likely the generated length will be on the lower end.
I like that; I think that is something like what Hypothesis does, and it seems to work fairly well.
Is there a way of setting compile-time settings for all of bolero? I have very complex data structures, which lead to something similar to the following (the real code uses many different collection types, but this was the easiest way to illustrate):
I know I can manually go into each type and annotate the vectors with something like
#[generator(Vec::gen().with().len(20usize..50))]
, but there are a lot of places where I'd need to do this. Is there a simple way of telling bolero that all collections should be limited to 5 items or fewer?