-
Notifications
You must be signed in to change notification settings - Fork 314
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
test(core): add unit tests for merge
trait
#1738
base: master
Are you sure you want to change the base?
Conversation
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.
Would it be valuable to include tests for conflict scenarios as well? For example:
let mut map1: BTreeMap<i32, &str> = BTreeMap::new();
map1.insert(1, "a");
let mut map2: BTreeMap<i32, &str> = BTreeMap::new();
map2.insert(1, "b");
map1.merge(map2);
assert_eq!(map1.len(), 1);
assert_eq!(map1.get(&1), Some(&"b"));
I've added refactored empty check assertions and merge conflict tests. Squashed. |
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.
ACK 871df7b
ACK 665273d |
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.
Great test additions. Here are some suggestions to make the tests more complete/easier to read.
Indeed, that's more readable. Updated. |
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.
Thanks for pushing forward on this. Let me know if you have any questions.
…ncluding conflict scenarios and checking for empty structures
Fixed and Rebased |
Description
This update adds unit tests for the
Merge
trait implementations onBTreeMap
,BTreeSet
,Vec
, and tuples. It also includes tests for theis_empty
andtake
methods to ensure their correct functionality.Notes to the Reviewers
BTreeSet
's existingtake
method.Changelog Notice
is_empty
,take
) on various collection types.Checklists
All Submissions:
cargo fmt
andcargo clippy
before committing.