-
Notifications
You must be signed in to change notification settings - Fork 30
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
Improve Gen.list by only testing [] once #377
Comments
As a secondary goal, I want to generalize this code slightly so that I can also use it to generate multi-dimensional arrays. The code I recently wrote for multi-dimensional arrays first picks the size and then picks the entries, so after some entry is shrunk, the size will never be shrunk again. |
Oh, but actually |
I can understand testing The general idea, I think, is to not generate the same combination of values in the entire property (considering all generators that are used in the property). (Whether it is desirable to optimize that away, is another matter.) |
I want to improve
Gen.list
. Actually, what I really want to do is (better) understandGen.list
, and I will be more motivated to do this by having a specific goal to improve it.Below is code that (if you are lucky) has the following output. It shows that
[]
is tested many times. Maybe I can figure out how to remove the repeated tests of[]
.Requiring luck to investigate this issue slows down progress, so it would be nice if #320 were resolved first.
Here is the shrink tree that I desire.
Even though
[0]
is also tested twice, my currently feeling is that it is not reasonable to remove that duplication. That comes from either removing the element at index 0 or the element at index 1. Because both elements are 0, both sublists are the same.The text was updated successfully, but these errors were encountered: