-
Notifications
You must be signed in to change notification settings - Fork 61
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
Fuzz iteration as part of operations #153
Conversation
Allows to test any interleaving of prev/next operations with commits, flushes...
fuzz/src/lib.rs
Outdated
}, | ||
IterPosition::End => { | ||
let expected = | ||
Self::valid_previous_values(&[u8::MAX, u8::MAX], &layers); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be IterPosition::End (current code works because key space is a single u8, but End would be better), by changing valid_previous_values to use IterPosition as parameter.
Same thing for valid_next_value call assuming the key are not 0 length
Edit: actually does not really matter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. It allowed me to factorise quite well the code. Thank you for pushing me to do it!
End, | ||
} | ||
|
||
pub struct DbWithIter { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could be name DbWithFuzzingContext or FuzzingDb. Ok I don't come up with a good name either, maybe change it only the day there is other contextual fields than iter related ones :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, seems better to wait for new contextual fields imho.
Allows to test any interleaving of prev/next operations with commits, flushes...