-
-
Notifications
You must be signed in to change notification settings - Fork 17
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
Fix bugs in get() and co + property based tests #88
Conversation
Oops, it seems that the |
Thanks for the PR, this is really cool! I have a few minor suggestions, but overall, it's really nice to have this additional testing, so thanks for all your work on this! In re: your questions:
Honestly, I would probably name it "properties" or something, instead of "fuzzing"...but I'm fine with "fuzzing", too...
It seems pretty unfortunate to bump our MSRV just for a test-only dependency. I'm fine with a dev-dependency on One small, procedural point: we use the Git history to generate this crate's changelog. If you don't mind, it would be really nice if the two bugfixes (the one for Thanks again for working on this! |
No problem, I'll do it. A good changelog is important. |
Fixes several clippy's lints: * non_canonical_clone_impl * needless_borrow
Prevents public methods from panicking if received keys that haven't been produced by the slab.
Fixes panics in `Slab::unique_iter()` in case of an empty slab. Fixes hawkw#73
Also, I updated the commits. Are they good enough for the CHANGELOG generation? Text from my previous PR was added to CHANGELOG. Does it still work the same way (should I also edit my first comment)? |
b1d9126
to
26111f8
Compare
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.
this looks great, thank you!
i guess we'll have to change the MSRV CI job to be build only, rather than running the tests, because of the memory_stats
thing. so, i'm fine with an indexmap
v2 dep if you prefer.
Adds property-based tests that check the following properties: * API never panics. * Active entries cannot be overridden until removed. * The slab doesn't produce overlapping keys. * The slab doesn't leave "lost" keys. * `get()`, `get_owned`, and `contains()` are consistent. * `RESERVED_BITS` are actually not used.
c4701db
to
7a70384
Compare
* Add `msrv` job * Add `RUST_BACKTRACE=1` * Add `-Dwarnings` * Fix clippy warnings in benches * Make job naming more consistent
@hawkw, I've fixed CI (see the latest commit's message + changes). Oh, it seems because of renaming the "required checks" logic doesn't work. Should I rename it back? |
I'll just fix those in the GitHub settings. Thanks for taking care of it! |
Fixes several clippy's lints: * non_canonical_clone_impl * needless_borrow
Prevents public methods from panicking if received keys that haven't been produced by the slab.
Fixes panics in `Slab::unique_iter()` in case of an empty slab. Fixes #73
Adds property-based tests that check the following properties: * API never panics. * Active entries cannot be overridden until removed. * The slab doesn't produce overlapping keys. * The slab doesn't leave "lost" keys. * `get()`, `get_owned`, and `contains()` are consistent. * `RESERVED_BITS` are actually not used.
* Add `msrv` job * Add `RUST_BACKTRACE=1` * Add `-Dwarnings` * Fix clippy warnings in benches * Make job naming more consistent
Okay, I just published v0.1.7, which includes the bugfixes. Thank you so much for working on this! |
I've written some
fuzzingproperty based tests for public API. Fortunately (or not), it's found only simple bugs with boundary checks (caught in staging, the reason why I've decided to check the slab in such a way).unique_iter
)get()
for some keysP.S. "fuzzing" is not an entirely valid name here. Initially, It checked only the absence of panics, so naming was more appropriate. Then, more properties were added. Would you happen to have any ideas on how to call it now?