Conversation
|
|
|
|
|
There was a problem hiding this comment.
Pull Request Overview
This PR enhances test coverage by adding API conformance tests for key data structures such as Vec, MinHeap, BTreeSet, and BTreeMap while renaming the misleading iter_upper_bound method to iter_from_prev_key.
- Adds a new module (api_conformance) with tests verifying the consistency of behavior between stable implementations and the standard library.
- Renames and deprecates iter_upper_bound in favor of the more descriptive iter_from_prev_key, with corresponding test updates.
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/lib.rs | Reorders module exports and adds the api_conformance module for tests. |
| src/btreeset/proptests.rs | Removes outdated iter_upper_bound tests in favor of the new method. |
| src/btreemap/proptests.rs | Renames and updates tests to use iter_from_prev_key instead of iter_upper_bound. |
| src/btreemap.rs | Introduces iter_from_prev_key and deprecates iter_upper_bound with updated docs. |
| src/api_conformance/* | Adds new tests for Vec, MinHeap, BTreeSet, and BTreeMap for API conformance. |
Comments suppressed due to low confidence (3)
src/lib.rs:29
- [nitpick] Consider adding an inline comment to explain the rationale for reordering the module exports, which can help future maintainers understand the changes.
pub use log::{Log as StableLog, Log};
src/btreeset/proptests.rs:69
- The removal of the iter_upper_bound test is noted; please ensure that the new iter_from_prev_key tests fully cover all necessary edge cases previously handled by this test.
-fn set_upper_bound_iter(#[strategy(pvec(0u64..u64::MAX - 1, 10..100))] keys: Vec<u64>) {
src/btreemap.rs:1213
- The deprecation note is clear; consider updating the module-level documentation to explicitly mention the renaming and migration path from iter_upper_bound to iter_from_prev_key for improved clarity.
#[deprecated(note = "use `iter_from_prev_key` instead")]
adambratschikaye
left a comment
There was a problem hiding this comment.
Would we also want to consider adding some property tests using quickcheck? We could generate a random sequence of operations and assert that they behave the same on both structures.
I made a note to myself, thank you! |
This PR enhances test coverage by adding API conformance tests for key data structures such as
Vec,MinHeap,BTreeSet, andBTreeMapwhile renaming the misleadingiter_upper_boundmethod toiter_from_prev_key.